From a51b729817ef8006939c213f5706222b60efd5ac Mon Sep 17 00:00:00 2001 From: Qingkun Li Date: Wed, 16 Oct 2019 04:23:40 -0700 Subject: [PATCH] add ignore_errors to the kube-proxy deletion task (#5236) When using cluster.yml or scale.yml to add/scale nodes in the existing k8s cluster, the `kubeadm init` wouldn't run. As a result, kube-proxy wouldn't be created, and therefore the kube-proxy deletion task would fail, e.g. in the case where kube-router is used and "kube_proxy_remove" is set to true. As a workaround, add ignore_errors to the kube-proxy deletion task. --- roles/kubernetes/kubeadm/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index 96b635a8f..88574725a 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -150,6 +150,8 @@ - inventory_hostname == groups['kube-master']|first - kube_proxy_remove - kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") + # When scaling/adding nodes in the existing k8s cluster, kube-proxy wouldn't be created, as `kubeadm init` wouldn't run. + ignore_errors: true tags: - kube-proxy