From 7ad326f7680d244969f75c463a6b9e36ae4cda28 Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:44:58 +0100 Subject: [PATCH] fix(upgrade-cluster): retry other masters upgrade (#9768) Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> --- roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml b/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml index 711a2e08394..d3d1d04f84c 100644 --- a/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml +++ b/roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml @@ -42,10 +42,11 @@ --etcd-upgrade={{ (etcd_deployment_type == "kubeadm") | bool | lower }} --force register: kubeadm_upgrade + # Retry is because upload config sometimes fails + retries: 3 + until: kubeadm_upgrade.rc == 0 when: inventory_hostname != first_kube_control_plane - failed_when: - - kubeadm_upgrade.rc != 0 - - '"field is immutable" not in kubeadm_upgrade.stderr' + failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr environment: PATH: "{{ bin_dir }}:{{ ansible_env.PATH }}" notify: Master | restart kubelet @@ -68,7 +69,7 @@ retries: 6 delay: 5 until: scale_down_coredns is succeeded - run_once: yes + run_once: true when: - kubeadm_scale_down_coredns_enabled - dns_mode not in ['coredns', 'coredns_dual']