terraform-provider-google icon indicating copy to clipboard operation
terraform-provider-google copied to clipboard

Serverless NEGs support outlier detection but `google_compute_backend_service` gets error when setting one up

Open WFrancois opened this issue 1 year ago • 11 comments

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 the 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 the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Hi!

Google recently announced a preview version of outlier detection for serverless NEGs.

More information here: https://cloud.google.com/load-balancing/docs/negs/serverless-neg-concepts#outlier-detection

Notably it says:

Outlier detection is an optional configuration that can be enabled on a global backend service that has serverless NEGs attached to it. The outlier detection analysis is only available for a global external Application Load Balancer and not for a classic Application Load Balancer. The outlier detection analysis identifies unhealthy serverless NEGs based on their HTTP response patterns, and reduces the error rate by routing some of the new requests from unhealthy services to healthy services.

Based on the type of server error that is encountered, you can use one of the following outlier detection methods to enable outlier detection:

  • Consecutive 5xx errors. A 5xx series HTTP status code qualifies as an error.
  • Consecutive gateway errors. Only 502, 503, and 504 HTTP status codes qualify as an error.

This feature would make the existing outlier_detection field available for EXTERNAL_MANAGED backend_service. However it shouldn't send field such as enforcing_success_rate.

This would allow to limit downtime on serverless services, something that was previously restricted to non-serverless compute.

New or Affected Resource(s)

  • google_compute_backend_service

Potential Terraform Configuration

The existing synthax used for INTERNAL_SELF_MANAGED can be used for this:

resource "google_compute_backend_service" "default" {
  name        = "backend-service-name"
  description = "Description"

  protocol    = "HTTP"
  port_name   = "http"
  timeout_sec = 30

  load_balancing_scheme = "EXTERNAL_MANAGED"

  outlier_detection {
    consecutive_errors = 2
  }
}

References

  • #4412

b/313874549

WFrancois avatar Jul 18 '23 13:07 WFrancois