Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop gcloud container engine clusters

I use gcloud to provision kubernetes clusters, and use container engine to do so.

Aside from the production cluster, I would like to create short-lived clusters, for testing etc'.

Instead of recreating clusters, I would like to have a test cluster and be able to stop/start on demand. Trying to hit "stop" on the vm instances listed at compute engine will make them restart eventually.

What is the proper way to stop & start a test cluster?

The motivation for short lived test clusters is from cost consideration.

like image 355
pazams Avatar asked Jul 12 '16 08:07

pazams


People also ask

How do I get rid of Kubectl clusters?

To remove a cluster, you can run kubectl --kubeconfig=config-demo config unset clusters. <name> To remove a context, you can run kubectl --kubeconfig=config-demo config unset contexts.


1 Answers

You can temporarily scale the number of nodes in your cluster down to zero by running:

gcloud container clusters resize $CLUSTER_NAME --num-nodes=0 

Then scale it back up later by running that with a non-zero value for the size flag.

like image 193
Alex Robinson Avatar answered Sep 28 '22 10:09

Alex Robinson