Remove Worker node from Kubernetes Cluster
Quote from moshe on 28/07/2022, 2:05 pmProblem
User wants to remove worker node from the cluster for maintenance
Solution
# List the nodes and get the <node-name> you want to remove from cluster
kubectl get nodes
# Drain the node
kubectl drain <node-name>
# If you want to completely remove data from the node
kubectl drain <node-name> –ignore-daemonsets –delete-local-data –force
# Delete the node
kubectl delete node <node-name>
Problem
User wants to remove worker node from the cluster for maintenance
Solution
# List the nodes and get the <node-name> you want to remove from cluster
kubectl get nodes
# Drain the node
kubectl drain <node-name>
# If you want to completely remove data from the node
kubectl drain <node-name> –ignore-daemonsets –delete-local-data –force
# Delete the node
Uploaded files:kubectl delete node <node-name>