Reputation: 39
How to safely delete node from the cluster?
Firstly, I have drained and deleted the node. However, after few seconds kube created again. I believe its because of the cluster service, where number of replicas are defined. Should i update my cluster service and delete ? Or is there any other way to safely delete ?
Upvotes: 0
Views: 77
Reputation: 3291
To delete a node and stop recreating another one automatically follow the below steps:
First drain the node
kubectl drain <node-name>
Edit instance group for nodes (using kops)
kops edit ig nodes
Finally delete the node
kubectl delete node <node-name>
Update the cluster (using kops)
kops update cluster --yes
Note: If you are using a pod autoscaler then disable or edit the replica count before deleting the node.
Upvotes: 1