Only fix kube-proxy address on evaluating kube_master hosts (#6152)

Change-Id: I83a7101a6cd99eb531d8385de5c31aee4f474469
This commit is contained in:
Matthew Mosesohn 2020-05-17 23:05:36 +03:00 committed by GitHub
parent 3997aa9a0f
commit fda05df5f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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