Kubernetes — Remove worker Node from the cluster and completely uninstall
In this tutorial, I will go through for removing a worker node from the cluster and then completing uninstall from the Kubernetes cluster.
From the master node -
i) List the nodes and get the
<node-name> you want to from the cluster
kubectl get nodes -o wide
ii) Drain or (remove from the cluster) the node
kubectl drain oel75.localdomain --delete-local-data --force --ignore-daemonsets
where oel75.localdomain — is the node that I would like to delete.
kubeadm get no
From the worker node:
iii) un-configure the kubernetes on the worker node
iv) Master Node: Delete the node and validate
kubectl delete node oel75.localdomain
Now completely uninstall kubernetes from the worker node —
# sudo yum remove kubeadm kubectl kubelet kubernetes-cni kube*
sudo yum autoremove
sudo rm -rf ~/.kube
So the node has been removed successfully.
I hope you know how to remove a worker node from the Kubernetes cluster.
Monowar Mukul is currently working as a Principal Oracle Database Specialist. I am an Oracle Certified Master (Oracle 12c Certified Master Administration, Oracle 12c Certified Master MAA, and Oracle 11g Certified Master Administration). He has been working as an Oracle DBA consultant for over 17 years with Oracle MAA space for both Exadata and non-Exadata Systems, Oracle Cloud Space, and SOA Middleware. He is working with different devops tools for over four years. You can find more details about him and his work achievements at https://www.linkedin.com/in/monowarmukul/