gippo
gippo

Reputation: 39

Nodegroups are recreated (as number replica needs to match)

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

Answers (1)

Sai Chandra Gadde
Sai Chandra Gadde

Reputation: 3291

To delete a node and stop recreating another one automatically follow the below steps:

  1. First drain the node

    kubectl drain <node-name>

  2. Edit instance group for nodes (using kops)

    kops edit ig nodes

  3. Finally delete the node

    kubectl delete node <node-name>

  4. 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

Related Questions