From 2864e13ff9992cd6bd05df6c236020e2bbd66b34 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Tue, 8 Oct 2019 10:15:12 +0300 Subject: [PATCH] Reset between kubeadm secondary control plane join attempts (#5240) Change-Id: Ic9425bf90552d7e3d42b02409af9773d99376384 --- .../master/tasks/kubeadm-secondary-experimental.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml b/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml index add7d7e4f..ccb6ddab6 100644 --- a/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml +++ b/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml @@ -49,7 +49,10 @@ msg: "{{ kubeadm_already_run.stat.exists }}" - name: Joining control plane node to the cluster. - command: >- + shell: >- + if [ -f /etc/kubernetes/manifests/kube-apiserver.yaml ]; then + {{ bin_dir }}/kubeadm reset -f --cert-dir {{ kube_cert_dir }}; + fi && {{ bin_dir }}/kubeadm join --config {{ kube_config_dir }}/kubeadm-controlplane.yaml --ignore-preflight-errors=all