Atsushi Suzuki
Posted on May 3, 2024
Procedure for reassociating worker nodes with the master node in on-premise Kubernetes after restarting the worker nodes.
++++++++++++++++++++++++++++++++
[Environment]
Ubuntu 20.10
Cluster Version 1.22.2
++++++++++++++++++++++++++++++++
1) Reset the state of kubelet using kubeadm. (on the worker node)
$ kubeadm reset
2) Generate the --discovery-token-ca-cert-hash (on the master node)
$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
Paste the output hash into a notepad for later use.
3) Generate a --token (on the master node)
$ kubeadm token create
Copy and paste the output token into a notepad.
4) Reassociate with the master node (on the worker node)
Use the values output in steps 2) and 3).
kubeadm join [Master Node IP]:6443 --token [token created on master node] --discovery-token-ca-cert-hash sha256:[hash value created on master node]
💖 💪 🙅 🚩
Atsushi Suzuki
Posted on May 3, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.