Is there a way to Backup/Stop and Restore/Start a GKE Cluster

6/7/2020

GKE Cluster runs on minimum 3 VM nodes and there is no way to Stop/Suspend the cluster like VMs to avoid burning money when you are not using it. Is there a workaround ?

-- Neil
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

6/8/2020

As pointed by user @Hitobat:

3 nodes is not the hard minimum, just the recommended min. you can reduce if needed.

You can create your cluster with only 1 node.

If you try to create cluster with only a default node-pool with less than 3 nodes you will get below warning message:

  • Clusters smaller than 3 nodes may experience downtime during upgrades


There are several ways to reduce costs associated with running a GKE cluster:

Scale down to 0 worker nodes

As pointed by user: @Amit Kumar Gupta:

Scale down to 0 worker nodes

Please take in mind that if you scale your default-pool to 0 you will need to manually increase it's size when additional resources are required. You can manage the amount of nodes in the cluster by invoking below gcloud command:

$ gcloud container clusters resize CLUSTER_NAME --node-pool NODE_POOL_NAME --num-nodes NUMBER_OF_NODES --zone ZONE

Enable auto scaling for your cluster

You can enable auto scaling for your cluster to reduce and increase amount of nodes in node pools automatically based on the cluster resources usage. There is an official documentation about it: Cloud.google.com: Kuberentes Engine: Cluster autoscaler

Take in mind that you can manually scale your cluster to 0 nodes even if auto scaling enabled but auto scaler will not scale up from 0 nodes.

Preemptible VM's

You have an option to run preemptible VM's with your GKE cluster. You can find more information about it here: Cloud.google.com: Kubernetes Engine: Preemptible VM's


Please take a look on additional links:

-- Dawid Kruk
Source: StackOverflow