From 270d38ea72c6c5923b3238f685f8acb7208ef96f Mon Sep 17 00:00:00 2001 From: Richard Franks Date: Thu, 20 Apr 2023 10:54:44 +0100 Subject: [PATCH] Added retry to networking setup for when the kubelet isn't quite ready yet --- tasks/control-plane-setup.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/control-plane-setup.yml b/tasks/control-plane-setup.yml index 347e5cc..267b94b 100644 --- a/tasks/control-plane-setup.yml +++ b/tasks/control-plane-setup.yml @@ -50,18 +50,24 @@ register: flannel_result changed_when: "'created' in flannel_result.stdout" when: kubernetes_pod_network.cni == 'flannel' + retries: 3 + delay: 5 - name: Configure Calico networking. command: "kubectl apply -f {{ kubernetes_calico_manifest_file }}" register: calico_result changed_when: "'created' in calico_result.stdout" when: kubernetes_pod_network.cni == 'calico' + retries: 3 + delay: 5 - name: Get Kubernetes version for Weave installation. shell: kubectl version | base64 | tr -d '\n' changed_when: false register: kubectl_version when: kubernetes_pod_network.cni == 'weave' + retries: 3 + delay: 5 - name: Configure Weave networking. command: "{{ item }}"