Skip to content

Commit

Permalink
only rengerate kubelet kubeconfig on control plane
Browse files Browse the repository at this point in the history
  • Loading branch information
kpiyush17 committed Jan 10, 2025
1 parent 1109a69 commit fb32134
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 fb32134

Please sign in to comment.