Ijaz Ahmad
Ijaz Ahmad

Reputation: 12110

How to Create Terraform code for GKE cluster

We can create/see the gcloud command from GKE cluster creation UI , is there a way to convert the command into terraform code for GKE cluster. thanks

Upvotes: 0

Views: 165

Answers (1)

hoque
hoque

Reputation: 6471

You can create GKE cluster by using terraform. There is a official link, by following you need to write the .tf file and apply.

resource "google_container_cluster" "primary" {
  name     = "my-gke-cluster"
  location = "us-central1"

  initial_node_count       = 1

  master_auth {
    username = ""
    password = ""

    client_certificate_config {
      issue_client_certificate = false
    }
  }
}

This is an useful tutorial.

Upvotes: 1

Related Questions