From fda05df5f132a498d1665d93dde37f41fef94de8 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Sun, 17 May 2020 23:05:36 +0300 Subject: [PATCH] Only fix kube-proxy address on evaluating kube_master hosts (#6152) Change-Id: I83a7101a6cd99eb531d8385de5c31aee4f474469 --- roles/kubernetes/kubeadm/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index c24400c0d..6923ac6f4 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -111,7 +111,9 @@ | {{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf replace -f - run_once: true delegate_to: "{{ groups['kube-master']|first }}" + delegate_facts: false when: + - inventory_hostname in groups['kube-master'] - kubeadm_config_api_fqdn is not defined - kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") - not kube_proxy_remove @@ -130,7 +132,9 @@ shell: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf delete pod -n kube-system -l k8s-app=kube-proxy --force --grace-period=0" run_once: true delegate_to: "{{ groups['kube-master']|first }}" + delegate_facts: false when: + - inventory_hostname in groups['kube-master'] - kubeadm_config_api_fqdn is not defined - kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") - not kube_proxy_remove