Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with "gcloud command not found" #519

Closed
sdevang opened this issue May 13, 2020 · 3 comments
Closed

Fails with "gcloud command not found" #519

sdevang opened this issue May 13, 2020 · 3 comments

Comments

@sdevang
Copy link

sdevang commented May 13, 2020

Hi,

I am running terraform apply from inside terraform cloud (inside the container) and it fails with following error.

Error: Error running command '.terraform/modules/gke/terraform-google-kubernetes-engine-9.0.0/modules/private-cluster/scripts/wait-for-cluster.sh example-prod-infra-core-175c example-prod-infra-core-gke01': exit status 127. Output: Waiting for cluster example-prod-infra-core-gke01 in project example-prod-infra-core-175c to reconcile...
.terraform/modules/gke/terraform-google-kubernetes-engine-9.0.0/modules/private-cluster/scripts/wait-for-cluster.sh: line 28: gcloud: command not found

My GKE config is,

module "gke" {
  source                     = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
  project_id                 = module.core_services_project.project_id
  name                       = "example-prod-infra-core-gke01"
  region                     = "europe-west2"
  zones                      = ["europe-west2-a", "europe-west2-b", "europe-west2-c"]
  network_project_id         = var.host_project
  network                    = "shared-vpc"
  subnetwork                 = "example-prod-infra-core-subnet01"
  ip_range_pods              = "example-prod-infra-core-subnet01-secondary"
  ip_range_services          = "example-prod-infra-core-subnet01-secondary"
  http_load_balancing        = true
  horizontal_pod_autoscaling = true
  network_policy             = true
  enable_private_endpoint    = true
  enable_private_nodes       = true
  create_service_account     = false
  add_cluster_firewall_rules = true
  remove_default_node_pool   = true
  service_account            = module.kubernetes_service_account.email
  default_max_pods_per_node  = 32
  master_authorized_networks = [
    {
      cidr_block   = "10.10.20.0/24"
      display_name = "VPC"
    }
  ]
  node_pools = [
    {
      name                      = "default-node-pool"
      machine_type              = "n1-standard-1"
      min_count                 = 1
      max_count                 = 1
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "UBUNTU"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = false
      #   initial_node_count = 80
    },
  ]

  node_pools_labels = {
    all = {}

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

  node_pools_metadata = {
    all = {}

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

  node_pools_tags = {
    all = []

    default-node-pool = [
      "default-node-pool",
    ]
  }
}
@bharathkkb
Copy link
Member

bharathkkb commented May 14, 2020

Hi @sdevang
You can set skip_provisioners=true to skip those local exec provisioners.

@morgante thoughts on using the gcloud module to install gcloud on terraform cloud? Not sure if that is the right long term approach.
Edit: Looks like we were planning to in #401

@sdevang
Copy link
Author

sdevang commented May 14, 2020

@bharathkkb Thanks for the reply.

I did set skip_provisioner=true and it did work after that.

I also tried installing gcloud in terraform cloud using "terraform-google-modules/terraform-google-gcloud" but it did not help.

@morgante
Copy link
Contributor

Yeah we'd need to fix this in the module via #401. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants