Skip to content

Commit

Permalink
Fixup kubelet.conf to point to kubelet-client-current.pem (kubernetes…
Browse files Browse the repository at this point in the history
…-sigs#7347)

c9c0c01 only fix the problem for new clusters

Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar authored and zexi committed Nov 9, 2022
1 parent d1b38a0 commit 57d9df0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions roles/kubernetes/master/tasks/kubelet-fix-client-cert-rotation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Fixup kubelet client cert rotation 1/2
lineinfile:
path: "{{ kube_config_dir }}/kubelet.conf"
regexp: '^ client-certificate-data: '
line: ' client-certificate: /var/lib/kubelet/pki/kubelet-client-current.pem'
backup: yes
notify:
- "Master | reload kubelet"

- name: Fixup kubelet client cert rotation 2/2
lineinfile:
path: "{{ kube_config_dir }}/kubelet.conf"
regexp: '^ client-key-data: '
line: ' client-key: /var/lib/kubelet/pki/kubelet-client-current.pem'
backup: yes
notify:
- "Master | reload kubelet"
4 changes: 4 additions & 0 deletions roles/kubernetes/master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@

- name: Include kubeadm secondary server apiserver fixes
include_tasks: kubeadm-fix-apiserver.yml

- name: Include kubelet client cert rotation fixes
include_tasks: kubelet-fix-client-cert-rotation.yml
when: kubelet_rotate_certificates

0 comments on commit 57d9df0

Please sign in to comment.