Resize a kubernetes cluster in Google Cloud

Haluk KARAKAYA
1 min readDec 22, 2020

Connect google cloud account and open your kubernetes cluster page.

Press the connect button and take gcloud shell. Run the command below.

gcloud container clusters resize cluster-1 --zone=us-central1-c --num-nodes 3

This command set the worker node size to 3. You can set this to zero if you want.

The explanation of the command is below.

gcloud container clusters resize CLUSTER_NAME --node-pool POOL_NAME --num-nodes NUM_NODES

Replace the following:

  • 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.

Repeat this command for each node pool. If your cluster has only one node pool, omit the --node-pool flag.

--

--