safely remove node from kubernetes cluster
Posted on June 28, 2021
When you need to remove a node from a kubernetes cluster, you can clean up the node first, by telling kubernetes to move all the pods to other nodes and not schedule anything new on the node.
Run this command to empty the node:
$ kubectl drain --ignore-daemonsets --delete-local-data name-of-the-node
After this command you can remove the node from the cluster without any impact on the running services.