Restart kube-proxy pods only on configmap changes (#11401)
parent
343d680371
commit
5f18fe739e
|
@ -158,6 +158,17 @@
|
||||||
- loadbalancer_apiserver is defined
|
- loadbalancer_apiserver is defined
|
||||||
notify: Kubeadm | restart kubelet
|
notify: Kubeadm | restart kubelet
|
||||||
|
|
||||||
|
- name: Get current resourceVersion of kube-proxy configmap
|
||||||
|
command: "{{ kubectl }} get configmap kube-proxy -n kube-system -o jsonpath='{.metadata.resourceVersion}'"
|
||||||
|
register: original_configmap_resource_version
|
||||||
|
run_once: true
|
||||||
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||||
|
delegate_facts: false
|
||||||
|
when:
|
||||||
|
- kube_proxy_deployed
|
||||||
|
tags:
|
||||||
|
- kube-proxy
|
||||||
|
|
||||||
# FIXME(mattymo): Need to point to localhost, otherwise masters will all point
|
# FIXME(mattymo): Need to point to localhost, otherwise masters will all point
|
||||||
# incorrectly to first master, creating SPoF.
|
# incorrectly to first master, creating SPoF.
|
||||||
- name: Update server field in kube-proxy kubeconfig
|
- name: Update server field in kube-proxy kubeconfig
|
||||||
|
@ -194,6 +205,17 @@
|
||||||
tags:
|
tags:
|
||||||
- kube-proxy
|
- kube-proxy
|
||||||
|
|
||||||
|
- name: Get new resourceVersion of kube-proxy configmap
|
||||||
|
command: "{{ kubectl }} get configmap kube-proxy -n kube-system -o jsonpath='{.metadata.resourceVersion}'"
|
||||||
|
register: new_configmap_resource_version
|
||||||
|
run_once: true
|
||||||
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||||
|
delegate_facts: false
|
||||||
|
when:
|
||||||
|
- kube_proxy_deployed
|
||||||
|
tags:
|
||||||
|
- kube-proxy
|
||||||
|
|
||||||
- name: Set ca.crt file permission
|
- name: Set ca.crt file permission
|
||||||
file:
|
file:
|
||||||
path: "{{ kube_cert_dir }}/ca.crt"
|
path: "{{ kube_cert_dir }}/ca.crt"
|
||||||
|
@ -210,6 +232,7 @@
|
||||||
- kubeadm_config_api_fqdn is not defined or loadbalancer_apiserver is defined
|
- kubeadm_config_api_fqdn is not defined or loadbalancer_apiserver is defined
|
||||||
- kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") or loadbalancer_apiserver is defined
|
- kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") or loadbalancer_apiserver is defined
|
||||||
- kube_proxy_deployed
|
- kube_proxy_deployed
|
||||||
|
- original_configmap_resource_version.stdout != new_configmap_resource_version.stdout
|
||||||
tags:
|
tags:
|
||||||
- kube-proxy
|
- kube-proxy
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue