3c8ad073cd
Using `kubeadm init phase kubeconfig all` breaks kubelet client certificate rotation as we are missing `kubeadm init phase kubelet-finalize all` to point to `kubelet-client-current.pem` kubeconfig format is stable so let's just use lineinfile, this will avoid other future breakage This revert to the logic before6fe2248314
Signed-off-by: Etienne Champetier <e.champetier@ateme.com> (cherry picked from commitc9c0c01de0
)
17 lines
452 B
YAML
17 lines
452 B
YAML
---
|
|
|
|
- name: Update server field in component kubeconfigs
|
|
lineinfile:
|
|
dest: "{{ kube_config_dir }}/{{ item }}"
|
|
regexp: '^ server: https'
|
|
line: ' server: {{ kube_apiserver_endpoint }}'
|
|
backup: yes
|
|
with_items:
|
|
- admin.conf
|
|
- controller-manager.conf
|
|
- kubelet.conf
|
|
- scheduler.conf
|
|
notify:
|
|
- "Master | Restart kube-controller-manager"
|
|
- "Master | Restart kube-scheduler"
|
|
- "Master | reload kubelet"
|