From 3261d26181307533fd7c0f7c86ee3fa4202b4189 Mon Sep 17 00:00:00 2001 From: Cristian Calin <6627509+cristicalin@users.noreply.github.com> Date: Sun, 17 Apr 2022 20:32:41 +0300 Subject: [PATCH] [etcd] ensure etcd is properly upgraded when managed by kubeadm (#8722) * [etcd] ensure etcd is properly upgraded when managed by kubeadm * [CI] add periodic job to test upgrade of etcd managed by kubeadm --- .gitlab-ci/packet.yml | 7 +++++++ .../control-plane/tasks/kubeadm-upgrade.yml | 4 ++-- ...cket_ubuntu20-calico-etcd-kubeadm-upgrade-ha.yml | 13 +++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/files/packet_ubuntu20-calico-etcd-kubeadm-upgrade-ha.yml diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml index a09627597..237e2b501 100644 --- a/.gitlab-ci/packet.yml +++ b/.gitlab-ci/packet.yml @@ -263,6 +263,13 @@ packet_centos7-docker-weave-upgrade-ha: variables: UPGRADE_TEST: basic +packet_ubuntu20-calico-etcd-kubeadm-upgrade-ha: + stage: deploy-part3 + extends: .packet_periodic + when: on_success + variables: + UPGRADE_TEST: basic + # Calico HA Wireguard packet_ubuntu20-calico-ha-wireguard: stage: deploy-part2 diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml b/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml index 8459362cd..711a2e083 100644 --- a/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml +++ b/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml @@ -18,7 +18,7 @@ --config={{ kube_config_dir }}/kubeadm-config.yaml --ignore-preflight-errors=all --allow-experimental-upgrades - --etcd-upgrade={{ etcd_deployment_type == "kubeadm" | bool | lower }} + --etcd-upgrade={{ (etcd_deployment_type == "kubeadm") | bool | lower }} --force register: kubeadm_upgrade # Retry is because upload config sometimes fails @@ -39,7 +39,7 @@ --config={{ kube_config_dir }}/kubeadm-config.yaml --ignore-preflight-errors=all --allow-experimental-upgrades - --etcd-upgrade={{ etcd_deployment_type == "kubeadm" | bool | lower }} + --etcd-upgrade={{ (etcd_deployment_type == "kubeadm") | bool | lower }} --force register: kubeadm_upgrade when: inventory_hostname != first_kube_control_plane diff --git a/tests/files/packet_ubuntu20-calico-etcd-kubeadm-upgrade-ha.yml b/tests/files/packet_ubuntu20-calico-etcd-kubeadm-upgrade-ha.yml new file mode 100644 index 000000000..db2bd6056 --- /dev/null +++ b/tests/files/packet_ubuntu20-calico-etcd-kubeadm-upgrade-ha.yml @@ -0,0 +1,13 @@ +--- +# Instance settings +cloud_image: ubuntu-2004 +mode: ha + +# use the legacy setting to test the upgrade +etcd_kubeadm_enabled: true + +upgrade_cluster_setup: true + +# Currently ipvs not available on KVM: https://packages.ubuntu.com/search?suite=focal&arch=amd64&mode=exactfilename&searchon=contents&keywords=ip_vs_sh.ko +kube_proxy_mode: iptables +enable_nodelocaldns: False