How to prevent a specific node from being killed during GKE node pool resize

6/20/2019

While reducing number of nodes in node pool in GKE, I want a specific node to be not killed by GKE. Is it possible to do that?

-- vinayakshnd
google-kubernetes-engine
kubernetes

1 Answer

6/20/2019

As explained in detail here - you can drain and delete the instance from the instance group (Not direct delete instance)

kubectl drain gke_instance_name  --force

The delete from instance group command followed by wait-until-stable command:

$ gcloud compute instance-groups managed delete-instances $GROUP_ID --instances=gke_instance_name

$ gcloud compute instance-groups managed wait-until-stable $GROUP_ID

This will not allow you to blacklist some instances from being deleted - but other way around that you can delete specific instances and leave others untouched.

-- Vishal Biyani
Source: StackOverflow