Skip to content

Commit

Permalink
Fixup kubelet.conf to point to kubelet-client-current.pem (#7347)
Browse files Browse the repository at this point in the history
c9c0c01 only fix the problem for new clusters

Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar authored Mar 9, 2021
1 parent b07c596 commit 14b63ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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/control-plane/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 14b63ed

Please sign in to comment.