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

Max utilization is not supported for Serverless network endpoint groups. #7051

Assignees
Labels

Comments

@icco
Copy link

icco commented Aug 18, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.13.0
+ provider registry.terraform.io/-/google v3.35.0
+ provider registry.terraform.io/-/google-beta v3.35.0
+ provider registry.terraform.io/-/null v2.1.2
+ provider registry.terraform.io/-/random v2.3.0
+ provider registry.terraform.io/hashicorp/google v3.35.0
+ provider registry.terraform.io/hashicorp/google-beta v3.35.0
+ provider registry.terraform.io/hashicorp/null v2.1.2
+ provider registry.terraform.io/hashicorp/random v2.3.0

Affected Resource(s)

  • google_compute_backend_service
  • google_compute_region_network_endpoint_group

Terraform Configuration Files

This is a simplified config that triggers the bug. A full example can be found at google/exposure-notifications-verification-server#248

resource "google_compute_region_network_endpoint_group" "cloudrun_neg" {
  provider              = google-beta
  name                  = "cloudrun-neg"
  network_endpoint_type = "SERVERLESS"
  region                = "us-central1"
  cloud_run {
    service = google_cloud_run_service.cloudrun_neg.name
  }
}

resource "google_cloud_run_service" "cloudrun_neg" {
  provider = google-beta
  name     = "cloudrun-neg"
  location = "us-central1"

  template {
    spec {
      containers {
        image = "gcr.io/cloudrun/hello"
      }
    }
  }

  traffic {
    percent         = 100
    latest_revision = true
  }
}

resource "google_compute_backend_service" "example" {
  provider   = google-beta
  name       = "example"
  project    = var.project

  backend {
    group = google_compute_region_network_endpoint_group.cloudrun_neg.id
  }
}

Debug Output

https://gist.github.com/icco/0e29297c1cb2e8e47b9c0759c1f84c87

Panic Output

Expected Behavior

Actual Behavior

Error: Error creating BackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].maxUtilization': '0.8'. Max utilization is not supported for Serverless network endpoint groups., invalid

  on main.tf line 78, in resource "google_compute_backend_service" "example":
  78: resource "google_compute_backend_service" "example" {

Steps to Reproduce

  1. terraform apply

Important Factoids

With the new serverless endpoint type, the default values we send are no longer valid.

References

  • #0000
@slevenick
Copy link
Collaborator

Ah yeah, I made this work specifically for global NEGs based on inferring type from their URL. A similar check will be needed for regional NEGs

@iangelov
Copy link

I attempted setting max_utilization (which is documented as being optional) to null (from its default value of 0.8), but to no avail.

@icco
Copy link
Author

icco commented Aug 26, 2020

This is still happening in 3.36 @slevenick

@slevenick
Copy link
Collaborator

@icco it looks like this was merged just after the 3.36 release was cut. It will be in the 3.37 release expected next monday

@icco
Copy link
Author

icco commented Aug 26, 2020

Is there any way I can test it or use it before then? I ask because we have a big release next week, and if there are bugs I'd love to not wait another week.

@slevenick
Copy link
Collaborator

@n-oden
Copy link

n-oden commented Sep 11, 2020

Small note on this: while it works, the maxUtilization etc values are still shown in the terraform plan output.

@slevenick
Copy link
Collaborator

Yeah, that's due to maxUtilization having a default value. It's tricky to remove without causing a breaking change, so I went with leaving it in the plan but stripping it from the request for serverless NEGs

@ghost
Copy link

ghost commented Sep 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.