terraform-google-kubernetes-engine icon indicating copy to clipboard operation
terraform-google-kubernetes-engine copied to clipboard

Unable to create the GKE Cluster

Open vishnugit24 opened this issue 3 years ago • 0 comments

TL;DR

I have used the below documentation link to create the GKE cluster by using the Terrraform code. But I am unable to create it I am getting an error while creating. Could anyone please help me here?

Documentation Link: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/latest

Expected behavior

I excepted the documentation code to work without any errors.

Observed behavior

Error:

Error: NodePool default-node-pool was created in the error state "ERROR" │ │ with module.kubernetes-engine.google_container_node_pool.pools["default-node-pool"], │ on .terraform/modules/kubernetes-engine/cluster.tf line 265, in resource "google_container_node_pool" "pools": │ 265: resource "google_container_node_pool" "pools" {

Terraform Configuration

data "google_client_config" "default" {}

provider "kubernetes" {
  host                   = "https://${module.gke.endpoint}"
  token                  = data.google_client_config.default.access_token
  cluster_ca_certificate = base64decode(module.gke.ca_certificate)
}

module "gke" {
  source                     = "terraform-google-modules/kubernetes-engine/google"
  project_id                 = "gkedemo"
  name                       = "gkecluster-demo"
  region                     = "us-central1"
  zones                      = ["us-central1-a", "us-central1-b", "us-central1-f"]
  network                    = "default"
  subnetwork                 = "default"
  ip_range_pods              = ""
  ip_range_services          = ""
  http_load_balancing        = false
  network_policy             = false
  horizontal_pod_autoscaling = true
  filestore_csi_driver       = false

  node_pools = [
    {
      name                      = "default-node-pool"
      machine_type              = "g1-small"
      node_locations            = "us-central1-b,us-central1-c"
      min_count                 = 1
      max_count                 = 6
      local_ssd_count           = 0
      spot                      = false
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      enable_gcfs               = false
      enable_gvnic              = false
      auto_repair               = true
      auto_upgrade              = true
      service_account           = "[email protected]	"
      preemptible               = false
      initial_node_count        = 5
    },
  ]

  node_pools_oauth_scopes = {
    all = []

    default-node-pool = [
      "https://www.googleapis.com/auth/cloud-platform",
    ]
  }

  node_pools_labels = {
    all = {}

    default-node-pool = {
      default-node-pool = true
    }
  }

  node_pools_metadata = {
    all = {}

    default-node-pool = {
      node-pool-metadata-custom-value = "my-node-pool"
    }
  }

  node_pools_taints = {
    all = []

    default-node-pool = [
      {
        key    = "default-node-pool"
        value  = true
        effect = "PREFER_NO_SCHEDULE"
      },
    ]
  }

  node_pools_tags = {
    all = []

    default-node-pool = [
      "default-node-pool",
    ]
  }
}

Terraform Version

Terraform Version:1.1.10

Additional information

No response

vishnugit24 avatar Jul 13 '22 17:07 vishnugit24