Multi-Zone Clusters

This page provides an overview of multi-zone cluster support in Kubernetes Engine.

Overview

Multi-zone clusters can help improve the availability of your applications by creating nodes in multiple geographic zones. This helps protect against downtime in the unlikely event of a zone-wide outage.

By default, clusters create nodes in a single zone specified at the time of creation. A multi-zone cluster creates nodes in multiple zones within the same region. All nodes in a multi-zone cluster are controlled by the same cluster master.

Using multiple zones uses requires more of your project's regional quotas. Ensure that you understand your quotas and the Kubernetes Engine pricing before using multi-zone clusters. If you encounter an Insufficient regional quota to satisfy request for resource error, your request exceeds your available quota in the current region.

How multi-zone clusters work

When you create a multi-zone cluster, either initially or by adding zones to an existing cluster, Kubernetes Engine makes the resource footprint the same in all zones.

For example, suppose that you request two VM instances with four cores each, and you ask for your cluster to be spread across three zones. In that case, you would get a total of 24 cores, with eight cores in each zone.

Resources are spread evenly across zones to ensure that Pods are scheduled evenly across zones. Doing so improves availability and failure recovery. If computing resources were spread unevenly across zones, the scheduler might not be able to schedule Pods evenly.

The default and any custom node pools in multi-zone clusters automatically have multi-zone availability. Those nodes also have labels applied in Kubernetes that indicate their failure domain, so that they can be taken into account by the Kubernetes scheduler.

Creating a new multi-zone cluster

Console

To create a multi-zone cluster, perform the following steps:

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Click Create cluster.

  3. Configure your cluster as desired, then click More.
  4. From the Additional zones menu, select some or all of the desired zones.
  5. Click Create.

gcloud

To create a multi-zone cluster, use the gcloud container clusters create command with the --additional-zones flag to specify additional, comma-delimited zones:

gcloud container clusters create [CLUSTER-NAME] --zone [ZONE] --additional-zones[ZONE,...]

For example:

gcloud container clusters create example-cluster --zone us-central1-f --additional-zones us-central1-a,us-central1-b

The above command returns the following output:

NAME             ZONE           MASTER_VERSION  MASTER_IP        MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
example-cluster  us-central1-f  x.x.x           xxx.xxx.xxx.xx   n1-standard-1  x.x.x         9          RUNNING

Notice that the total number of nodes is nine. When the --num-nodes flag is omitted, the default number of per-zone nodes created by the cluster is three. Because three zones were specified, this command creates a nine-node cluster with three nodes each in us-central1-f, us-central1-a, and us-central1-b.

Adding multiple zones to an existing cluster

Console

To add additional zones to an existing cluster, perform the following steps:

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster, then click Edit.

  3. From the Additional zones menu, select some or all of the desired zones.
  4. Click Save.

gcloud

To add zones to a cluster, use the gcloud beta container clusters update command with the --additional-zones flag to specify additional, comma-delimited zones:

gcloud beta container clusters update [CLUSTER-NAME] --zone [ZONE] --additional-zones [ZONE,...]

For example:

gcloud beta container clusters update example-cluster --zone us-central1-a --additional-zones us-central1-f

Removing zones from an existing cluster

Console

To remove zones from an existing cluster, perform the following steps:

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster, then click Edit.

  3. From the Additional zones menu, deselect some or all of the desired zones.
  4. Click Save.

gcloud

To remove zones from a cluster, use the gcloud beta container clusters update command with the --additional-zones flag. Passing an empty string to the flag removes all zones except the primary zone:

gcloud beta container clusters update [CLUSTER-NAME] --zone [ZONE] --additional-zones ""

For example:

gcloud beta container clusters update example-cluster --zone us-central1-a --additional-zones ""

What's next

Monitor your resources on the go

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

Send feedback about...

Kubernetes Engine