4

How do I turn off a Google Container Cluster instead of deleting it?

I tried: Shutting down the VMs that were created by the cluster. Only to find a day later, that they were restarted.

The alternative is that delete the clusters and re-create them later. But that is unnecessary work which I would like to avoid.

Screenshot

EDIT: I found this (gcloud container clusters resize $NAME --resize=0). However, is there a way to do this from the web console or the iOS app?

Unapiedra
  • 143
  • 1
  • 5

3 Answers3

1

There isn't a way to resize to zero from the cloud console (and since the iOS app uses the console I'm guessing it applies there too, although I haven't been able to verify).

Robert Bailey
  • 599
  • 3
  • 6
1

The above command will resize the Pool [default-pool] for your cluster to zero. The correct format is using the flag --size not --resize with the --zone flag as follows:

gcloud container clusters resize [cluster name] --size=0 --zone [cluster zone]

Good news, now you are able to do so through the console’s UI by editing the cluster, scrolling to Node pools, and changing the size to 0. (couldn’t verify for an IOS app). However, this may not solve your issue, as per this official note,

"Beginning with Kubernetes version 1.7, you can specify a minimum size of zero for your node pool. This allows your node pool to scale down completely if the instances within aren't required to run your workloads. However, while a node pool can scale to a zero size, the overall cluster size does not scale down to zero nodes (as at least one node is always required to run system Pods)."

And per this Google groups discussion, “there needs to be at least some space for keeping the cluster operational”.

That said, an alternative in your case is to delete the node pool “in which it does not drain or reschedule”.

EDIT [2019.09.02] Noting there is no charge for the master node required to run system pods: See https://cloud.google.com/kubernetes-engine/pricing : "Because GKE abstracts away the existence of the master, you are not charged for the master node."

Fady
  • 206
  • 1
  • 5
0

Yes, there is a way to scale GKE down from the console.

Navigate to clusters, then to the pool at the very bottom. The default name for the pool would be default-pool. Click on edit and change the number of nodes. You can refer to the picture below.

GKE Edit Nodes Size