user630702
user630702

Reputation: 3167

Google Cloud Kubernetes - How to create Zonal or Regional GKE cluster?

How do I know if I'm using Zonal or Regional when using the following terraform code? I want Zonal since GCP doesn't charge GKE Management fees when using Zonal GKE cluster.

But I'm not sure if the following is Zonal or Regional?

resource "google_container_cluster" "primary" {
  name     = "my-gke-cluster"
  network            = "default"
  location               = "europe-west1"
  initial_node_count = 1
  }

Upvotes: 0

Views: 259

Answers (1)

Ryan Siu
Ryan Siu

Reputation: 1002

Google Kubernetes Engine defines the regional as multiple-zonal. For a zone, it is indicated by an alphabet, like a, b, c.

So, here are the examples for the location.

  • Regional/Multiple-zonal: europe-west1, us-west1, etc.
  • Zonal: europe-west1-b, us-west1-a, etc.

In your terraform module, if you want to have zonal GKE cluster, it looks like this.

resource "google_container_cluster" "primary" {
  name               = "zonal-cluster"
  network            = "default"
  location           = "europe-west1-b"
  initial_node_count = 1
}

Upvotes: 3

Related Questions