Overview of Multi-Zone Clusters

This page provides an overview of multi-zone cluster support in Container Engine. Multi-zone clusters are a way to have nodes from different zones in a single cluster, all controlled by the same master.

When to use multi-zone clusters

Multi-zone Container Engine clusters are primarily used as a way to improve availability of your application in the unlikely event of a zone outage.

How multi-zone clusters work

When you create a multi-zone cluster, either initially or by adding zones to an existing cluster, Container Engine makes the resource footprint the same in all zones. That is, the managed instance groups are the same size in all zones. For example, suppose you request two VM instances with four cores each, and you ask for your cluster to be spread across three zones. You would get 24 cores with 8 cores across the three zones.

The reason for spreading resources evenly across zones is to ensure that pods of containers get scheduled evenly across zones. This improves availability and failure recovery. If computing resources were spread unevenly across zones, the scheduler might not be able to spread pods evenly among zones, even though it makes a best effort to do so.

You can configure the use of multiple zones when you create a cluster. In the gcloud container clusters create command, use the --additional-zones flag to specify additional zones:

gcloud container clusters create multi-prod --zone us-central1-f --additional-zones=us-central1-a,us-central1-b

This command produces the following output:

NAME        ZONE           MASTER_VERSION  MASTER_IP        MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
multi-prod  us-central1-f  1.3.2           xxx.xxx.xxx.xx   n1-standard-1  1.3.2         9          RUNNING

As you can see in gcloud container clusters create --help, the --num-nodes option is per-zone and defaults to three, so the preceding command creates a nine-node cluster, with three nodes each in us-central1-f, us-central1-a, and us-central1-b.

You can then also create node pools with similar multi-zone availability:

gcloud container node-pools create larger-pool --cluster=multi-prod --num-nodes=2

This command produces the following output:

NAME        ZONE           MASTER_VERSION  MASTER_IP        MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
multi-prod  us-central1-f  1.3.2           xxx.xxx.xxx.xx   n1-standard-1  1.3.2         6          RUNNING

This created a new node pool named larger-pool. Those nodes will also have labels applied in Kubernetes that indicate their failure domain, so that they can be taken into account by the Kubernetes scheduler.

More information

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Container Engine