From 423fe7e51dc5bbd59a0428628dacc7ed96374370 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 29 Mar 2017 23:28:05 +0300 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +++ roles/kubernetes/master/tasks/post-upgrade.yml | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 186251328..2a0106162 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,7 @@ before_script: PRIVATE_KEY: $GCE_PRIVATE_KEY GS_ACCESS_KEY_ID: $GS_KEY GS_SECRET_ACCESS_KEY: $GS_SECRET + CLOUD_MACHINE_TYPE: "g1-small" ANSIBLE_KEEP_REMOTE_FILES: "1" ANSIBLE_CONFIG: ./tests/ansible.cfg BOOTSTRAP_OS: none @@ -97,6 +98,7 @@ before_script: -e gce_credentials_file=${HOME}/.ssh/gce.json -e gce_project_id=${GCE_PROJECT_ID} -e gce_service_account_email=${GCE_ACCOUNT} + -e cloud_machine_type=${CLOUD_MACHINE_TYPE} -e inventory_path=${PWD}/inventory/inventory.ini -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} -e mode=${CLUSTER_MODE} @@ -265,6 +267,7 @@ before_script: KUBE_NETWORK_PLUGIN: canal CLOUD_IMAGE: ubuntu-1604-xenial CLOUD_REGION: europe-west1-b + CLOUD_MACHINE_TYPE: "n1-standard-2" UPGRADE_TEST: "basic" CLUSTER_MODE: ha UPGRADE_TEST: "graceful" diff --git a/roles/kubernetes/master/tasks/post-upgrade.yml b/roles/kubernetes/master/tasks/post-upgrade.yml index d157311de..e99912976 100644 --- a/roles/kubernetes/master/tasks/post-upgrade.yml +++ b/roles/kubernetes/master/tasks/post-upgrade.yml @@ -1,11 +1,23 @@ --- -- name: "Post-upgrade | restart kubelet on all masters" +- name: "Post-upgrade | stop kubelet on all masters" service: name: kubelet - state: restarted + state: stopped + delegate_to: "{{item}}" + with_items: "{{groups['kube-master']}}" + when: needs_etcd_migration|bool + +- name: "Post-upgrade | Pause for kubelet stop" + pause: + seconds: 10 + when: needs_etcd_migration|bool + +- name: "Post-upgrade | stop kubelet on all masters" + service: + name: kubelet + state: started delegate_to: "{{item}}" with_items: "{{groups['kube-master']}}" - register: kube_apiserver_manifest_replaced when: needs_etcd_migration|bool - name: "Post-upgrade | etcd3 upgrade | purge etcd2 k8s data"