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

feat: Added support for google_compute_backend_service outlier_detection #365

Conversation

btkelly
Copy link
Contributor

@btkelly btkelly commented Oct 11, 2023

This PR adds support for outlier_detection that is part of the google_compute_backend_service Terraform module. It's just a passthrough of properties matching what is available in the google_compute_backend_service modules.

@btkelly btkelly requested review from imrannayer and a team as code owners October 11, 2023 20:52
@google-cla
Copy link

google-cla bot commented Oct 11, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@btkelly btkelly force-pushed the add-outlier-detection-support branch from 7d839bc to e6c9a4b Compare October 11, 2023 21:00
@btkelly btkelly changed the title Added support for google_compute_backend_service outlier_detection feat: Added support for google_compute_backend_service outlier_detection Oct 11, 2023
@imrannayer
Copy link
Collaborator

/gcbrun

@btkelly
Copy link
Contributor Author

btkelly commented Oct 13, 2023

@imrannayer thanks for triggering the build. I see that the build failed but I don't seem to have access to view the build result. If you can share the issue I can make any required changes. Thanks.

@imrannayer
Copy link
Collaborator

@btkelly seems like it failed to execute this example

       module.example.module.gce-lb-http.google_compute_firewall.default-hc[0]: Creating...
       module.example.module.gce-lb-http.google_compute_health_check.default["default"]: Creating...
       module.example.module.gce-lb-http.google_compute_firewall.default-hc[0]: Still creating... [10s elapsed]
       module.example.module.gce-lb-http.google_compute_health_check.default["default"]: Still creating... [10s elapsed]
       module.example.module.gce-lb-http.google_compute_firewall.default-hc[0]: Creation complete after 11s [id=projects/ci-int-lb-http-decf/global/firewalls/ci-crossproject-lb-hc-0]
       module.example.module.gce-lb-http.google_compute_health_check.default["default"]: Creation complete after 11s [id=projects/ci-int-lb-http-1-4a42/global/healthChecks/ci-crossproject-lb-hc-default]
       module.example.module.gce-lb-http.google_compute_backend_service.default["default"]: Creating...
       module.example.module.gce-lb-http.google_compute_backend_service.default["default"]: Still creating... [10s elapsed]
       module.example.module.gce-lb-http.google_compute_backend_service.default["default"]: Still creating... [20s elapsed]
       module.example.module.gce-lb-http.google_compute_backend_service.default["default"]: Creation complete after 22s [id=projects/ci-int-lb-http-1-4a42/global/backendServices/ci-crossproject-lb-backend-default]
       module.example.module.gce-lb-http.google_compute_url_map.default[0]: Creating...
       
       Error: Error creating UrlMap: googleapi: Error 400: Invalid value for field 'resource.defaultService': 'https://www.googleapis.com/compute/v1/projects/ci-int-lb-http-1-4a42/global/backendServices/ci-crossproject-lb-backend-default'. Cross-project references for this resource are not allowed., invalid
       
         with module.example.module.gce-lb-http.google_compute_url_map.default[0],
         on ../../../main.tf line 163, in resource "google_compute_url_map" "default":
        163: resource "google_compute_url_map" "default" {

@btkelly
Copy link
Contributor Author

btkelly commented Nov 1, 2023

@imrannayer I've looked over the error and am not sure how my change would have caused that example to fail. Do you have any insight into what might be causing this?

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

@btkelly can you plz fix following:

  1. Since outlier detection is only supported for load balancing schema INTERNAL_SELF_MANAGED can you plz add condition that this part of code will only execute if load balancing schema is INTERNAL_SELF_MANAGED.
  2. Can you plz check if Traffic director (load balancing schema INTERNAL_SELF_MANAGED) supports Serverless NEG? If not then can you plz add it to autogen template in a way that Serverless NEG dont show this code?

@btkelly
Copy link
Contributor Author

btkelly commented Nov 3, 2023

@imrannayer I did originally have that check in my PR but I removed it because I want to use the outlier detection specifically for my EXTERNAL_MANAGED LB that routes to Cloud Run (serverless neg). I have noticed that in the TF module it's listed as not supported but when I use the GCP console I can configure this without issues. Is the console wrong by letting me configure that or are the Terraform modules out of date with newly added capabilities of the GCP EXTERNAL_MANAGED load balancer type?

@imrannayer
Copy link
Collaborator

@btkelly I think you are right. According to API doc:

Applicable backend endpoints can be:

- VM instances in an Instance Group
- Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT)
- Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT)
- Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services
- Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect

Applicable backend service types can be:

- A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED.

Can you plz set condition load balancing scheme NTERNAL_SELF_MANAGED or EXTERNAL_MANAGED?

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer merged commit 8554cd0 into terraform-google-modules:master Nov 6, 2023
4 checks passed
@btkelly btkelly deleted the add-outlier-detection-support branch November 6, 2023 18:24
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

Successfully merging this pull request may close these issues.

2 participants