Skip to main content

Posts

Showing posts from December, 2019

How to Remove and add a Node from a K8S cluster.

First login to the Control-plane node where you can list the nodes. 1) Drain the node (Remove from cluster) # kubectl drain <node name> You might have to ignore daemonsets and local-data in the machine # kubectl drain --ignore-daemonsets --delete-local-data 2) Now delete the node # kubectl delete node <node name> Now if you want to add the node again, you might want to re-generate the token of kubeadm join command for adding the worker. Always use the --v=5 along with the kubeadm join command which will show the error description. # kubeadm token create Now use this token for the kubeadm join command , so that you can join the worker node.