Skip to content

Commit

Permalink
Merge pull request #89 from sighupio/feat/kubelet-server-cert-renew
Browse files Browse the repository at this point in the history
feat(node-common): add task for server-side certificate kubelet renew
  • Loading branch information
nutellinoit authored Jul 31, 2024
2 parents b23ae91 + d59c40f commit defccb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/kube-node-common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ kubeadm_version: "{{ kubernetes_version }}"
critools_version: "{{ dependencies[kubernetes_version].critools_version }}"

skip_kubelet_upgrade: False
kubelet_pki_cert_file: /var/lib/kubelet/pki/kubelet.crt
kubelet_pki_key_file: /var/lib/kubelet/pki/kubelet.key

dependencies:
# To pin dependencies for each Kubernetes version
Expand Down
13 changes: 13 additions & 0 deletions roles/kube-node-common/tasks/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@

# Finish install Kubernetes packages

# Start remove kubelet server certificate,key for later renew when restart kubelet service

- name: Remove kubelet crt and key for later renew
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ kubelet_pki_cert_file }}"
- "{{ kubelet_pki_key_file }}"
when: not skip_kubelet_upgrade

# Finish remove kubelet server certificate,key for later renew when restart kubelet service

- name: Start and enable Kubelet service
systemd:
name: kubelet
Expand Down

0 comments on commit defccb8

Please sign in to comment.