1

In order to save costs, we would like to stop or hibernate an Kubernetes GKE cluster in GCP cloud. I could not find any hint on this in documentation.

Did I miss something?

1

1 Answer 1

1

As OP mentioned in comment, there is possibility to start/stop GKE cluster using resize command from gcloud. However as new versions and features comes out, this command needs to be tuned.

In current default version (1.15.12-gke.2) GKE is using Node Pools. It allows you to have a few node pools and each of them can have different Image type, Machine configuration, disk size, etc.

Due to this, while you are resizing cluster you also need specify which node pool you want to resize.

gcloud container clusters resize cluster-name --node-pool pool-name \
    --num-nodes num-nodes

cluster-name: the name of the cluster to resize.

pool-name: the name of the node pool to resize.

num-nodes: the number of nodes in the pool in a zonal cluster. If you use multi-zonal or regional clusters, num-nodes is the number of nodes for each zone the node pools is in.

When you use this command you can increase or decrease numbers of nodes in your node pool. You don't need to worry that if you will resize your node pools to 0 you will delete/loss data in cluster, as Master is managed by google and when you will resize up node pool all configuration and deployed resources will be still there.

However there is another solution, to use Cluster Autoscaler.

GKE's cluster autoscaler automatically resizes the number of nodes in a given node pool, based on the demands of your workloads. You don't need to manually add or remove nodes or over-provision your node pools. Instead, you specify a minimum and maximum size for the node pool, and the rest is automatic.

1
  • +1 I was looking for a reassurance that I would not lose configuration Dec 19, 2020 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .