diff --git a/mmv1/products/compute/BackendService.yaml b/mmv1/products/compute/BackendService.yaml index 52a7339eda6e..62ffad4771bb 100644 --- a/mmv1/products/compute/BackendService.yaml +++ b/mmv1/products/compute/BackendService.yaml @@ -769,6 +769,7 @@ properties: - :RANDOM - :ORIGINAL_DESTINATION - :MAGLEV + - :WEIGHTED_MAGLEV description: | The load balancing algorithm used within the scope of the locality. The possible values are: @@ -797,16 +798,32 @@ properties: build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 + * `WEIGHTED_MAGLEV`: Per-instance weighted Load Balancing via health check + reported weights. If set, the Backend Service must + configure a non legacy HTTP-based Health Check, and + health check replies are expected to contain + non-standard HTTP response header field + X-Load-Balancing-Endpoint-Weight to specify the + per-instance weights. If set, Load Balancing is weight + based on the per-instance weights reported in the last + processed health check replies, as long as every + instance either reported a valid weight or had + UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains + equal-weight. + This field is applicable to either: * A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED. * A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * A regional backend service with loadBalancingScheme set to EXTERNAL (External Network + Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External + Network Load Balancing. The default is MAGLEV. - If session_affinity is not NONE, and this field is not set to MAGLEV or RING_HASH, - session affinity settings will not take effect. + If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV, + or RING_HASH, session affinity settings will not take effect. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validate_for_proxyless diff --git a/mmv1/products/compute/RegionBackendService.yaml b/mmv1/products/compute/RegionBackendService.yaml index 047c601e6400..2ee320a9fe8e 100644 --- a/mmv1/products/compute/RegionBackendService.yaml +++ b/mmv1/products/compute/RegionBackendService.yaml @@ -71,6 +71,12 @@ examples: region_backend_service_name: "region-service" health_check_name: "rbs-health-check" min_version: beta + - !ruby/object:Provider::Terraform::Examples + name: "region_backend_service_external_weighted" + primary_resource_id: "default" + vars: + region_backend_service_name: "region-service" + health_check_name: "rbs-health-check" - !ruby/object:Provider::Terraform::Examples name: "region_backend_service_ilb_ring_hash" primary_resource_id: "default" @@ -781,6 +787,7 @@ properties: - :RANDOM - :ORIGINAL_DESTINATION - :MAGLEV + - :WEIGHTED_MAGLEV description: | The load balancing algorithm used within the scope of the locality. The possible values are: @@ -809,16 +816,32 @@ properties: build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 + * `WEIGHTED_MAGLEV`: Per-instance weighted Load Balancing via health check + reported weights. If set, the Backend Service must + configure a non legacy HTTP-based Health Check, and + health check replies are expected to contain + non-standard HTTP response header field + X-Load-Balancing-Endpoint-Weight to specify the + per-instance weights. If set, Load Balancing is weight + based on the per-instance weights reported in the last + processed health check replies, as long as every + instance either reported a valid weight or had + UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains + equal-weight. + This field is applicable to either: * A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED. * A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * A regional backend service with loadBalancingScheme set to EXTERNAL (External Network + Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External + Network Load Balancing. The default is MAGLEV. - If session_affinity is not NONE, and this field is not set to MAGLEV or RING_HASH, - session affinity settings will not take effect. + If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV, + or RING_HASH, session affinity settings will not take effect. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validate_for_proxyless diff --git a/mmv1/templates/terraform/examples/region_backend_service_external_weighted.tf.erb b/mmv1/templates/terraform/examples/region_backend_service_external_weighted.tf.erb new file mode 100644 index 000000000000..a09a7c4295e9 --- /dev/null +++ b/mmv1/templates/terraform/examples/region_backend_service_external_weighted.tf.erb @@ -0,0 +1,17 @@ +resource "google_compute_region_backend_service" "<%= ctx[:primary_resource_id] %>" { + region = "us-central1" + name = "<%= ctx[:vars]['region_backend_service_name'] %>" + health_checks = [google_compute_region_health_check.health_check.id] + protocol = "TCP" + load_balancing_scheme = "EXTERNAL" + locality_lb_policy = "WEIGHTED_MAGLEV" +} + +resource "google_compute_region_health_check" "health_check" { + name = "<%= ctx[:vars]['health_check_name'] %>" + region = "us-central1" + + http_health_check { + port = 80 + } +}