Browse Source

Fix nginx-proxy HA when kubeadm enable

pull/2859/head
rongzhang 6 years ago
parent
commit
f9ccb93825
1 changed files with 4 additions and 4 deletions
  1. 8
      roles/kubernetes/kubeadm/tasks/main.yml

8
roles/kubernetes/kubeadm/tasks/main.yml

@ -53,10 +53,10 @@
timeout: 60
- name: Update server field in kubelet kubeconfig
replace:
path: "{{ kube_config_dir }}/kubelet.conf"
regexp: '(\s+)https://{{ first_kube_master }}:{{ kube_apiserver_port }}(\s+.*)?$'
replace: '\1{{ kube_apiserver_endpoint }}\2'
lineinfile:
dest: "{{ kube_config_dir }}/kubelet.conf"
regexp: 'server:'
line: ' server: {{ kube_apiserver_endpoint }}'
backup: yes
when: not is_kube_master and kubeadm_discovery_address != kube_apiserver_endpoint
notify: restart kubelet

Loading…
Cancel
Save