Marshall
Marshall

Reputation: 433

Shutting down VM on Google Compute Engine always restarts

I set up a 1 node cluster on google container engine which I just intend to use for testing, so I want to be able keep it shutdown while I am not using it to keep my costs low. I can not however figure out why the VM continually restarts after I shut it down through the console. I have set the "Automatic Restarts" option to false on the VM.

The VM is a n1-standard-2 (2 vCPUs, 7.5 GB memory) with 2 standard persistent disks attached.

Has anyone else faced this issue, or have experience with how to set up GCE so that you can keep it offline while not in use? Thanks in advance for any help.

Upvotes: 2

Views: 143

Answers (1)

Alex Robinson
Alex Robinson

Reputation: 13377

The VMs in GKE clusters are managed by what's called a Managed Instance Group, which ensures that there's always the expected number of nodes in your cluster. I'd guess that it's seeing that there isn't a VM running in your project and assuming that something's gone wrong, so it recreates it.

You could stop it from doing so by explicitly resizing the instance group down to 0. You can change the number of nodes in the cluster either via the Container Engine UI or by running gcloud container clusters resize $CLUSTERNAME --size=0.

Upvotes: 1

Related Questions