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
kubectl delete node <node-name>
Attachment: commands.txt
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →