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

net-lb*-int - backends[].balancing mode - review possibile values #1767

Closed
3 of 4 tasks
wiktorn opened this issue Oct 17, 2023 · 2 comments · Fixed by #1769
Closed
3 of 4 tasks

net-lb*-int - backends[].balancing mode - review possibile values #1767

wiktorn opened this issue Oct 17, 2023 · 2 comments · Fixed by #1769

Comments

@wiktorn
Copy link
Collaborator

wiktorn commented Oct 17, 2023

Found in modules/net-lb-int when applying end-to-end example, but this may affect also other Load Balancer modules:

Error creating RegionBackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].balancingMode': 'UTILIZATION'. Balancing mode must be CONNECTION for an INTERNAL backend service., invalid

Cross checked with docs and analysis for each of the module below.

net-lb-int

This are allowed values (according to docs) for Internal passthrough Network Load Balancer
image

net-lb-ext

Only CONNECTION allowed per docs, but no changes necessary as this attribute is not controlled by module inputs.

  • Small update in the doc string to clean up UTILIZATION

net-lb-proxy-int

OK

net-lb-app-int

OK. Can add vallidation:

  validation {
    condition = alltrue([
      for b in var.backend_service_config.backends : contains(
        ["RATE", "UTILIZATION"], coalesce(b.balancing_mode, "UTILIZATION")
    )])
    error_message = "When specified balancing mode needs to be 'RATE' or 'UTILIZATION'."
  }

net-lb-app-ext

OK. Can add vallidation:

  validation {
    condition = alltrue([
      for b in var.backend_service_config.backends : contains(
        ["RATE", "UTILIZATION"], coalesce(b.balancing_mode, "UTILIZATION")
    )])
    error_message = "When specified balancing mode needs to be 'RATE' or 'UTILIZATION'."
  }
@ludoo
Copy link
Collaborator

ludoo commented Oct 17, 2023

It's not a module-level but a blueprint problem. :)

@ludoo
Copy link
Collaborator

ludoo commented Oct 17, 2023

defaults are correct for each load balancer type, and need to be changed in blueprints to suit specific backends

wiktorn added a commit that referenced this issue Oct 18, 2023
## net-lb-int
* Fix error on apply of example:
```
Error creating RegionBackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].balancingMode': 'UTILIZATION'. Balancing mode must be CONNECTION for an INTERNAL backend service., invalid
```
* remove unused `balancing_mode` variable, as only one value is possible anyhow

## net-lb-ext
* update in the `backends` description

## net-lb-proxy-int
* update in the `backends` description

## net-lb-app-int
* added validation of `balancing_mode`
* fixed other validations

## net-lb-app-ext
* added validation of `balancing_mode`
* fixed other validations
* removed validation for `locality_lb_policy` as this variable is not used in this module

Closes: #1767
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 a pull request may close this issue.

2 participants