Skip to content

[BUG] gke-cluster create fails on subnet is not valid for Network #5

@dmizin

Description

@dmizin

Describe the bug
Running step "2-gke-cluster" produces error at network setup and fails

To Reproduce
Steps to reproduce the behavior:

  1. Go to multicloud-platform/gcp-gke/terraform/uswest1/2-gke-cluster/
  2. Run terraform apply
  3. See error
    │ Error: googleapi: Error 400: Subnetwork "projects/<edited>/regions/us-west2/subnetworks/environment01-us-west2-subnet" is not valid for Network "default"., badRequest │ │ with module.gke.google_container_cluster.primary, │ on ..\..\..\tfm\2-gke-cluster\main.tf line 7, in resource "google_container_cluster" "primary": │ 7: resource "google_container_cluster" "primary" { │

Expected behavior
GKE Cluster created

Additional context
Error appears to be the result of Line 12 of multicloud-platform/gcp-gke/tfm/2-gke-cluster/main.tf
Currently:
network = data.google_compute_network.vpc1.name
Should be:
network = "${var.network_name}"

Once updated, the cluster creation completes as expected. vpc1.name could point to expected name, or not - depending on customer's environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtracked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions