Skip to content

Commit

Permalink
only rengerate kubelet kubeconfig on control plane (#166)
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Kumar <[email protected]>
  • Loading branch information
kpiyush17 authored Jan 10, 2025
1 parent 1109a69 commit b8bb163
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/kube-reconfigure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ regenerate_apiserver_certs_sans() {
regenerate_kubelet_envs() {
echo "$kubelet_envs" > /var/lib/kubelet/kubeadm-flags.env

mv /etc/kubernetes/kubelet.conf /etc/kubernetes/kubelet.conf.bak
kubeadm init phase kubeconfig kubelet
if [ "$node_role" != "worker" ];
then
mv /etc/kubernetes/kubelet.conf /etc/kubernetes/kubelet.conf.bak
kubeadm init phase kubeconfig kubelet
fi

systemctl restart kubelet
}
Expand Down

0 comments on commit b8bb163

Please sign in to comment.