From 9eced8e6983c50a16a8154c75c3b4c3fd63b9887 Mon Sep 17 00:00:00 2001 From: Adam Buran Date: Fri, 10 Apr 2026 15:30:43 -0700 Subject: [PATCH 1/3] feat(loadbalancer): support slow start aggression and minWeightPercent Expose the `aggression` and `minWeightPercent` parameters of Envoy's SlowStartConfig via BackendTrafficPolicy. Previously only the slow start `window` was configurable, which limited users to a linear ramp-up. `aggression` enables polynomial/exponential ramp-up curves, and `minWeightPercent` guards against starvation when the scaled weight would otherwise approach zero. Addresses the existing TODO in the SlowStart API type. Signed-off-by: Adam Buran --- api/v1alpha1/loadbalancer_types.go | 28 +- api/v1alpha1/zz_generated.deepcopy.go | 10 + ....envoyproxy.io_backendtrafficpolicies.yaml | 28 +- ....envoyproxy.io_envoyextensionpolicies.yaml | 29 +- .../gateway.envoyproxy.io_envoyproxies.yaml | 120 ++++++- ...ateway.envoyproxy.io_securitypolicies.yaml | 117 ++++++- ....envoyproxy.io_backendtrafficpolicies.yaml | 28 +- ....envoyproxy.io_envoyextensionpolicies.yaml | 29 +- .../gateway.envoyproxy.io_envoyproxies.yaml | 120 ++++++- ...ateway.envoyproxy.io_securitypolicies.yaml | 117 ++++++- internal/gatewayapi/clustersettings.go | 59 ++-- ...endtrafficpolicy-with-loadbalancer.in.yaml | 2 + ...ndtrafficpolicy-with-loadbalancer.out.yaml | 4 + internal/ir/xds.go | 6 + internal/ir/zz_generated.deepcopy.go | 10 + internal/xds/translator/cluster.go | 32 +- .../testdata/in/xds-ir/load-balancer.yaml | 4 + .../out/xds-ir/load-balancer.clusters.yaml | 8 + release-notes/current.yaml | 1 + site/content/en/latest/api/extension_types.md | 4 +- .../backendtrafficpolicy_test.go | 60 +++- test/helm/gateway-crds-helm/all.out.yaml | 294 +++++++++++++++++- test/helm/gateway-crds-helm/e2e.out.yaml | 294 +++++++++++++++++- .../envoy-gateway-crds.out.yaml | 294 +++++++++++++++++- 24 files changed, 1611 insertions(+), 87 deletions(-) diff --git a/api/v1alpha1/loadbalancer_types.go b/api/v1alpha1/loadbalancer_types.go index 8132e8f38b..c73d6414df 100644 --- a/api/v1alpha1/loadbalancer_types.go +++ b/api/v1alpha1/loadbalancer_types.go @@ -287,11 +287,35 @@ const ( type SlowStart struct { // Window defines the duration of the warm up period for newly added host. // During slow start window, traffic sent to the newly added hosts will gradually increase. - // Currently only supports linear growth of traffic. For additional details, + // For additional details, // see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig // +kubebuilder:validation:Required Window *gwapiv1.Duration `json:"window"` - // TODO: Add support for non-linear traffic increases based on user usage. + + // Aggression controls the speed at which the endpoint weight ramps up during the + // slow start window. The endpoint weight is scaled by the time factor raised to + // the power of (1 / aggression). Values greater than 1.0 result in a faster + // initial ramp-up followed by a slower approach to the full weight (exponential), + // while values less than 1.0 result in a slower initial ramp-up followed by a + // faster approach to the full weight (logarithmic). + // + // Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + // Envoy uses its default of 1.0, which produces a linear ramp-up. + // + // +optional + // +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?|\.[0-9]+)$` + // +kubebuilder:validation:XValidation:rule="self != '0' && self != '0.0' && self != '.0'",message="aggression must be greater than 0" + Aggression *string `json:"aggression,omitempty"` + + // MinWeightPercent specifies the minimum percent of origin weight that avoids + // too small new weight when an endpoint is in slow start window. This ensures + // that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + // default of 10%. + // + // +optional + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + MinWeightPercent *uint32 `json:"minWeightPercent,omitempty"` } // ZoneAware defines the configuration related to the distribution of requests between locality zones. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 3fa446c0c6..c04fa54455 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -7725,6 +7725,16 @@ func (in *SlowStart) DeepCopyInto(out *SlowStart) { *out = new(v1.Duration) **out = **in } + if in.Aggression != nil { + in, out := &in.Aggression, &out.Aggression + *out = new(string) + **out = **in + } + if in.MinWeightPercent != nil { + in, out := &in.MinWeightPercent, &out.MinWeightPercent + *out = new(uint32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlowStart. diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 4453989c01..d1fcbd30eb 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -1049,11 +1049,37 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index 2f67685ec6..9ca7e9f2e4 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1135,11 +1135,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml index 3c0748a8ca..604b2f0733 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12452,11 +12452,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -13976,11 +14004,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -15661,11 +15717,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater + than 0 + rule: self != '0' && self != '0.0' + && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -17255,11 +17339,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && self + != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml index 21f522c267..39d5388386 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1768,11 +1768,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -3164,11 +3191,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -4843,11 +4897,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && + self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -6533,11 +6615,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 5b04769153..66c3f7c33d 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -1048,11 +1048,37 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index 7138e01ad0..593097cad6 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1134,11 +1134,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml index ade6d8979c..59a02ad80a 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12451,11 +12451,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -13975,11 +14003,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -15660,11 +15716,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater + than 0 + rule: self != '0' && self != '0.0' + && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -17254,11 +17338,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && self + != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml index 3d839207a6..1a40f7ac14 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1767,11 +1767,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -3163,11 +3190,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -4842,11 +4896,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && + self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -6532,11 +6614,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/internal/gatewayapi/clustersettings.go b/internal/gatewayapi/clustersettings.go index 21d1b20d05..1b808612fe 100644 --- a/internal/gatewayapi/clustersettings.go +++ b/internal/gatewayapi/clustersettings.go @@ -12,6 +12,7 @@ import ( "math/big" "net/http" "reflect" + "strconv" "strings" "time" @@ -331,15 +332,11 @@ func buildLoadBalancer(policy *egv1a1.ClusterSettings) (*ir.LoadBalancer, error) lb = &ir.LoadBalancer{ LeastRequest: &ir.LeastRequest{}, } - if policy.LoadBalancer.SlowStart != nil && policy.LoadBalancer.SlowStart.Window != nil { - d, err := time.ParseDuration(string(*policy.LoadBalancer.SlowStart.Window)) - if err != nil { - return nil, err - } - lb.LeastRequest.SlowStart = &ir.SlowStart{ - Window: ir.MetaV1DurationPtr(d), - } + slowStart, err := buildSlowStart(policy.LoadBalancer.SlowStart) + if err != nil { + return nil, err } + lb.LeastRequest.SlowStart = slowStart case egv1a1.RandomLoadBalancerType: lb = &ir.LoadBalancer{ Random: &ir.Random{}, @@ -348,15 +345,11 @@ func buildLoadBalancer(policy *egv1a1.ClusterSettings) (*ir.LoadBalancer, error) lb = &ir.LoadBalancer{ RoundRobin: &ir.RoundRobin{}, } - if policy.LoadBalancer.SlowStart != nil && policy.LoadBalancer.SlowStart.Window != nil { - d, err := time.ParseDuration(string(*policy.LoadBalancer.SlowStart.Window)) - if err != nil { - return nil, err - } - lb.RoundRobin.SlowStart = &ir.SlowStart{ - Window: ir.MetaV1DurationPtr(d), - } + slowStart, err := buildSlowStart(policy.LoadBalancer.SlowStart) + if err != nil { + return nil, err } + lb.RoundRobin.SlowStart = slowStart case egv1a1.BackendUtilizationLoadBalancerType: lb = &ir.LoadBalancer{ BackendUtilization: &ir.BackendUtilization{}, @@ -392,15 +385,11 @@ func buildLoadBalancer(policy *egv1a1.ClusterSettings) (*ir.LoadBalancer, error) } lb.BackendUtilization.KeepResponseHeaders = new(ptr.Deref(backendUtilization.KeepResponseHeaders, false)) } - if policy.LoadBalancer.SlowStart != nil && policy.LoadBalancer.SlowStart.Window != nil { - d, err := time.ParseDuration(string(*policy.LoadBalancer.SlowStart.Window)) - if err != nil { - return nil, err - } - lb.BackendUtilization.SlowStart = &ir.SlowStart{ - Window: ir.MetaV1DurationPtr(d), - } + slowStart, err := buildSlowStart(policy.LoadBalancer.SlowStart) + if err != nil { + return nil, err } + lb.BackendUtilization.SlowStart = slowStart } // Add ZoneAware loadbalancer settings @@ -436,6 +425,28 @@ func buildLoadBalancer(policy *egv1a1.ClusterSettings) (*ir.LoadBalancer, error) return lb, nil } +func buildSlowStart(slowStart *egv1a1.SlowStart) (*ir.SlowStart, error) { + if slowStart == nil || slowStart.Window == nil { + return nil, nil + } + d, err := time.ParseDuration(string(*slowStart.Window)) + if err != nil { + return nil, err + } + ret := &ir.SlowStart{ + Window: ir.MetaV1DurationPtr(d), + MinWeightPercent: slowStart.MinWeightPercent, + } + if slowStart.Aggression != nil { + aggression, err := strconv.ParseFloat(*slowStart.Aggression, 64) + if err != nil { + return nil, fmt.Errorf("invalid slowStart.aggression %q: %w", *slowStart.Aggression, err) + } + ret.Aggression = &aggression + } + return ret, nil +} + func buildConsistentHashLoadBalancer(policy egv1a1.LoadBalancer) (*ir.ConsistentHash, error) { consistentHash := &ir.ConsistentHash{} diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml index 56b54f786d..439895f55b 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml @@ -200,6 +200,8 @@ backendTrafficPolicies: type: LeastRequest slowStart: window: 300s + aggression: "1.5" + minWeightPercent: 25 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: BackendTrafficPolicy metadata: diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml index d83171cdf6..1c7fb30d19 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml @@ -42,6 +42,8 @@ backendTrafficPolicies: spec: loadBalancer: slowStart: + aggression: "1.5" + minWeightPercent: 25 window: 300s type: LeastRequest targetRef: @@ -755,6 +757,8 @@ xdsIR: loadBalancer: leastRequest: slowStart: + aggression: 1.5 + minWeightPercent: 25 window: 5m0s - destination: metadata: diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 6a80b9129a..02127871f8 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -2953,6 +2953,12 @@ type ProxyProtocol struct { type SlowStart struct { // Window defines the duration of the warm up period for newly added host. Window *metav1.Duration `json:"window" yaml:"window"` + // Aggression is the parameter that controls the speed of the endpoint weight + // ramp-up during the slow start window. If nil, Envoy's default (1.0) is used. + Aggression *float64 `json:"aggression,omitempty" yaml:"aggression,omitempty"` + // MinWeightPercent is the minimum percent of origin weight used while an + // endpoint is in the slow start window. If nil, Envoy's default (10%) is used. + MinWeightPercent *uint32 `json:"minWeightPercent,omitempty" yaml:"minWeightPercent,omitempty"` } // Backend CircuitBreaker settings for the DEFAULT routing priority diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 8cc3268cbc..1067d236b7 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -4130,6 +4130,16 @@ func (in *SlowStart) DeepCopyInto(out *SlowStart) { *out = new(metav1.Duration) **out = **in } + if in.Aggression != nil { + in, out := &in.Aggression, &out.Aggression + *out = new(float64) + **out = **in + } + if in.MinWeightPercent != nil { + in, out := &in.MinWeightPercent, &out.MinWeightPercent + *out = new(uint32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlowStart. diff --git a/internal/xds/translator/cluster.go b/internal/xds/translator/cluster.go index 5e566f80a3..27d70a1814 100644 --- a/internal/xds/translator/cluster.go +++ b/internal/xds/translator/cluster.go @@ -366,9 +366,7 @@ func buildXdsCluster(args *xdsClusterArgs) (*buildClusterResult, error) { LocalityLbConfig: localityLbConfig, } if args.loadBalancer.LeastRequest.SlowStart != nil && args.loadBalancer.LeastRequest.SlowStart.Window != nil { - leastRequest.SlowStartConfig = &commonv3.SlowStartConfig{ - SlowStartWindow: durationpb.New(args.loadBalancer.LeastRequest.SlowStart.Window.Duration), - } + leastRequest.SlowStartConfig = buildSlowStartConfig(args.loadBalancer.LeastRequest.SlowStart) } typedLeastRequest, err := proto.ToAnyWithValidation(leastRequest) if err != nil { @@ -387,9 +385,7 @@ func buildXdsCluster(args *xdsClusterArgs) (*buildClusterResult, error) { LocalityLbConfig: localityLbConfig, } if args.loadBalancer.RoundRobin.SlowStart != nil && args.loadBalancer.RoundRobin.SlowStart.Window != nil { - roundRobin.SlowStartConfig = &commonv3.SlowStartConfig{ - SlowStartWindow: durationpb.New(args.loadBalancer.RoundRobin.SlowStart.Window.Duration), - } + roundRobin.SlowStartConfig = buildSlowStartConfig(args.loadBalancer.RoundRobin.SlowStart) } typedRoundRobin, err := proto.ToAnyWithValidation(roundRobin) if err != nil { @@ -453,9 +449,7 @@ func buildXdsCluster(args *xdsClusterArgs) (*buildClusterResult, error) { cswrr.WeightUpdatePeriod = durationpb.New(v.WeightUpdatePeriod.Duration) } if v.SlowStart != nil && v.SlowStart.Window != nil && v.SlowStart.Window.Duration > 0 { - cswrr.SlowStartConfig = &commonv3.SlowStartConfig{ - SlowStartWindow: durationpb.New(v.SlowStart.Window.Duration), - } + cswrr.SlowStartConfig = buildSlowStartConfig(v.SlowStart) } if v.ErrorUtilizationPenaltyPercent != nil { cswrr.ErrorUtilizationPenalty = wrapperspb.Float(float32(*v.ErrorUtilizationPenaltyPercent) / 100.0) @@ -689,6 +683,26 @@ func buildXdsOutlierDetection(outlierDetection *ir.OutlierDetection) *clusterv3. return od } +// buildSlowStartConfig translates the IR SlowStart configuration into the +// Envoy SlowStartConfig used by round-robin and least-request load balancers. +// Callers must ensure slowStart and slowStart.Window are non-nil. +func buildSlowStartConfig(slowStart *ir.SlowStart) *commonv3.SlowStartConfig { + cfg := &commonv3.SlowStartConfig{ + SlowStartWindow: durationpb.New(slowStart.Window.Duration), + } + if slowStart.Aggression != nil { + cfg.Aggression = &corev3.RuntimeDouble{ + DefaultValue: *slowStart.Aggression, + } + } + if slowStart.MinWeightPercent != nil { + cfg.MinWeightPercent = &xdstype.Percent{ + Value: float64(*slowStart.MinWeightPercent), + } + } + return cfg +} + // buildHTTPStatusRange converts an array of http status to an array of the range of http status. func buildHTTPStatusRange(irStatuses []ir.HTTPStatus) []*xdstype.Int64Range { if len(irStatuses) == 0 { diff --git a/internal/xds/translator/testdata/in/xds-ir/load-balancer.yaml b/internal/xds/translator/testdata/in/xds-ir/load-balancer.yaml index c59f30a804..c7012d0b72 100644 --- a/internal/xds/translator/testdata/in/xds-ir/load-balancer.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/load-balancer.yaml @@ -78,6 +78,8 @@ http: roundRobin: slowStart: window: 300s + aggression: 1.5 + minWeightPercent: 25 destination: name: "sixth-route-dest" settings: @@ -227,6 +229,8 @@ http: weightUpdatePeriod: 10s slowStart: window: 45s + aggression: 2 + minWeightPercent: 15 errorUtilizationPenaltyPercent: 100 metricNamesForComputingUtilization: - "cpu_utilization" diff --git a/internal/xds/translator/testdata/out/xds-ir/load-balancer.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/load-balancer.clusters.yaml index cdde7a1721..5408a226f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/load-balancer.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/load-balancer.clusters.yaml @@ -134,6 +134,10 @@ localityLbConfig: localityWeightedLbConfig: {} slowStartConfig: + aggression: + defaultValue: 1.5 + minWeightPercent: + value: 25 slowStartWindow: 300s name: sixth-route-dest perConnectionBufferLimitBytes: 32768 @@ -375,6 +379,10 @@ metricNamesForComputingUtilization: - cpu_utilization slowStartConfig: + aggression: + defaultValue: 2 + minWeightPercent: + value: 15 slowStartWindow: 45s weightExpirationPeriod: 60s weightUpdatePeriod: 10s diff --git a/release-notes/current.yaml b/release-notes/current.yaml index ce695f50e2..40df2ce337 100644 --- a/release-notes/current.yaml +++ b/release-notes/current.yaml @@ -23,6 +23,7 @@ new features: | Support for configuring weights for locality zones. Added support for settings of gRPC web in ClientTrafficPolicy. Added support for Envoy Dynamic Modules. + Added support for `aggression` and `minWeightPercent` in BackendTrafficPolicy slow start configuration. Added support for weight in BackendRef API to enable traffic splitting for non-x-route resources. Added support for removing headers based on matching criteria (Exact, Prefix, Suffix, RegularExpression) in ClientTrafficPolicy EarlyRequestHeaders and LateResponseHeaders. Added support for priorityClassName in KubernetesPodSpec for Envoy Proxy pods. diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 5ef4099805..0bf17fe296 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -5656,7 +5656,9 @@ _Appears in:_ | Field | Type | Required | Default | Description | | --- | --- | --- | --- | --- | -| `window` | _[Duration](https://gateway-api.sigs.k8s.io/reference/1.5/spec/#duration)_ | true | | Window defines the duration of the warm up period for newly added host.
During slow start window, traffic sent to the newly added hosts will gradually increase.
Currently only supports linear growth of traffic. For additional details,
see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig | +| `window` | _[Duration](https://gateway-api.sigs.k8s.io/reference/1.5/spec/#duration)_ | true | | Window defines the duration of the warm up period for newly added host.
During slow start window, traffic sent to the newly added hosts will gradually increase.
For additional details,
see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig | +| `aggression` | _string_ | false | | Aggression controls the speed at which the endpoint weight ramps up during the
slow start window. The endpoint weight is scaled by the time factor raised to
the power of (1 / aggression). Values greater than 1.0 result in a faster
initial ramp-up followed by a slower approach to the full weight (exponential),
while values less than 1.0 result in a slower initial ramp-up followed by a
faster approach to the full weight (logarithmic).
Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset,
Envoy uses its default of 1.0, which produces a linear ramp-up. | +| `minWeightPercent` | _integer_ | false | | MinWeightPercent specifies the minimum percent of origin weight that avoids
too small new weight when an endpoint is in slow start window. This ensures
that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its
default of 10%. | #### SourceMatch diff --git a/test/cel-validation/backendtrafficpolicy_test.go b/test/cel-validation/backendtrafficpolicy_test.go index ff9ea5c259..8bd9476b94 100644 --- a/test/cel-validation/backendtrafficpolicy_test.go +++ b/test/cel-validation/backendtrafficpolicy_test.go @@ -585,7 +585,9 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { LoadBalancer: &egv1a1.LoadBalancer{ Type: egv1a1.RoundRobinLoadBalancerType, SlowStart: &egv1a1.SlowStart{ - Window: new(gwapiv1.Duration("10ms")), + Window: ptr.To(gwapiv1.Duration("10ms")), + Aggression: ptr.To("1.5"), + MinWeightPercent: ptr.To[uint32](25), }, }, }, @@ -593,6 +595,62 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { }, wantErrors: []string{}, }, + { + desc: "roundrobin with zero aggression is rejected", + mutate: func(btp *egv1a1.BackendTrafficPolicy) { + btp.Spec = egv1a1.BackendTrafficPolicySpec{ + PolicyTargetReferences: egv1a1.PolicyTargetReferences{ + TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{ + LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{ + Group: gwapiv1.Group("gateway.networking.k8s.io"), + Kind: gwapiv1.Kind("Gateway"), + Name: gwapiv1.ObjectName("eg"), + }, + }, + }, + ClusterSettings: egv1a1.ClusterSettings{ + LoadBalancer: &egv1a1.LoadBalancer{ + Type: egv1a1.RoundRobinLoadBalancerType, + SlowStart: &egv1a1.SlowStart{ + Window: ptr.To(gwapiv1.Duration("10ms")), + Aggression: ptr.To("0"), + }, + }, + }, + } + }, + wantErrors: []string{ + "aggression must be greater than 0", + }, + }, + { + desc: "roundrobin with non-numeric aggression is rejected", + mutate: func(btp *egv1a1.BackendTrafficPolicy) { + btp.Spec = egv1a1.BackendTrafficPolicySpec{ + PolicyTargetReferences: egv1a1.PolicyTargetReferences{ + TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{ + LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{ + Group: gwapiv1.Group("gateway.networking.k8s.io"), + Kind: gwapiv1.Kind("Gateway"), + Name: gwapiv1.ObjectName("eg"), + }, + }, + }, + ClusterSettings: egv1a1.ClusterSettings{ + LoadBalancer: &egv1a1.LoadBalancer{ + Type: egv1a1.RoundRobinLoadBalancerType, + SlowStart: &egv1a1.SlowStart{ + Window: ptr.To(gwapiv1.Duration("10ms")), + Aggression: ptr.To("fast"), + }, + }, + }, + } + }, + wantErrors: []string{ + "spec.loadBalancer.slowStart.aggression", + }, + }, { desc: " random with SlowStart is set", mutate: func(btp *egv1a1.BackendTrafficPolicy) { diff --git a/test/helm/gateway-crds-helm/all.out.yaml b/test/helm/gateway-crds-helm/all.out.yaml index 6000e3e719..30312432c5 100644 --- a/test/helm/gateway-crds-helm/all.out.yaml +++ b/test/helm/gateway-crds-helm/all.out.yaml @@ -23576,11 +23576,37 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -28991,11 +29017,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -43290,11 +43343,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -44814,11 +44895,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -46499,11 +46608,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater + than 0 + rule: self != '0' && self != '0.0' + && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -48093,11 +48230,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && self + != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -51145,11 +51310,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -52541,11 +52733,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -54220,11 +54439,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && + self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -55910,11 +56157,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/test/helm/gateway-crds-helm/e2e.out.yaml b/test/helm/gateway-crds-helm/e2e.out.yaml index a6de282a0b..80b11ff336 100644 --- a/test/helm/gateway-crds-helm/e2e.out.yaml +++ b/test/helm/gateway-crds-helm/e2e.out.yaml @@ -1549,11 +1549,37 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -6964,11 +6990,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -21263,11 +21316,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -22787,11 +22868,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -24472,11 +24581,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater + than 0 + rule: self != '0' && self != '0.0' + && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -26066,11 +26203,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && self + != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -29118,11 +29283,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -30514,11 +30706,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -32193,11 +32412,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && + self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -33883,11 +34130,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string diff --git a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml index 5ef15f3270..f87d07ccad 100644 --- a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml +++ b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml @@ -1549,11 +1549,37 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -6964,11 +6990,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -21263,11 +21316,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -22787,11 +22868,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be + greater than 0 + rule: self != '0' && self != + '0.0' && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -24472,11 +24581,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater + than 0 + rule: self != '0' && self != '0.0' + && self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -26066,11 +26203,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && self + != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -29118,11 +29283,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -30514,11 +30706,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -32193,11 +32412,39 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than + 0 + rule: self != '0' && self != '0.0' && + self != '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string @@ -33883,11 +34130,38 @@ spec: If set, during slow start window, traffic sent to the newly added hosts will gradually increase. Supported for RoundRobin, LeastRequest, and BackendUtilization load balancers. properties: + aggression: + description: |- + Aggression controls the speed at which the endpoint weight ramps up during the + slow start window. The endpoint weight is scaled by the time factor raised to + the power of (1 / aggression). Values greater than 1.0 result in a faster + initial ramp-up followed by a slower approach to the full weight (exponential), + while values less than 1.0 result in a slower initial ramp-up followed by a + faster approach to the full weight (logarithmic). + + Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, + Envoy uses its default of 1.0, which produces a linear ramp-up. + pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ + type: string + x-kubernetes-validations: + - message: aggression must be greater than 0 + rule: self != '0' && self != '0.0' && self != + '.0' + minWeightPercent: + description: |- + MinWeightPercent specifies the minimum percent of origin weight that avoids + too small new weight when an endpoint is in slow start window. This ensures + that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its + default of 10%. + format: int32 + maximum: 100 + minimum: 0 + type: integer window: description: |- Window defines the duration of the warm up period for newly added host. During slow start window, traffic sent to the newly added hosts will gradually increase. - Currently only supports linear growth of traffic. For additional details, + For additional details, see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string From 88915fd642857d9d4e9423c38250705d1c2f63ca Mon Sep 17 00:00:00 2001 From: Adam Buran Date: Sat, 11 Apr 2026 14:43:55 -0700 Subject: [PATCH 2/3] refactor(loadbalancer): use percentage-based integer for slow start aggression Change SlowStart.Aggression from a decimal string (e.g. "1.5") to a percentage-based uint32 where 100 represents 1.0x, matching the convention used by BackendUtilization.ErrorUtilizationPenaltyPercent in the same struct family. This removes the regex pattern and CEL XValidation rule from the API type, drops the strconv.ParseFloat call in the gatewayapi translator (and its runtime error path), and relies on a simple Minimum=1 validation instead. Per review feedback on #3144c52fc. Signed-off-by: Adam Buran --- api/v1alpha1/loadbalancer_types.go | 16 +- api/v1alpha1/zz_generated.deepcopy.go | 2 +- ....envoyproxy.io_backendtrafficpolicies.yaml | 19 +- ....envoyproxy.io_envoyextensionpolicies.yaml | 20 +- .../gateway.envoyproxy.io_envoyproxies.yaml | 84 ++++---- ...ateway.envoyproxy.io_securitypolicies.yaml | 81 ++++--- ....envoyproxy.io_backendtrafficpolicies.yaml | 19 +- ....envoyproxy.io_envoyextensionpolicies.yaml | 20 +- .../gateway.envoyproxy.io_envoyproxies.yaml | 84 ++++---- ...ateway.envoyproxy.io_securitypolicies.yaml | 81 ++++--- internal/gatewayapi/clustersettings.go | 6 +- ...endtrafficpolicy-with-loadbalancer.in.yaml | 2 +- ...ndtrafficpolicy-with-loadbalancer.out.yaml | 2 +- site/content/en/latest/api/extension_types.md | 2 +- .../backendtrafficpolicy_test.go | 32 +-- test/helm/gateway-crds-helm/all.out.yaml | 204 ++++++++++-------- test/helm/gateway-crds-helm/e2e.out.yaml | 204 ++++++++++-------- .../envoy-gateway-crds.out.yaml | 204 ++++++++++-------- 18 files changed, 618 insertions(+), 464 deletions(-) diff --git a/api/v1alpha1/loadbalancer_types.go b/api/v1alpha1/loadbalancer_types.go index c73d6414df..06238139f2 100644 --- a/api/v1alpha1/loadbalancer_types.go +++ b/api/v1alpha1/loadbalancer_types.go @@ -299,13 +299,19 @@ type SlowStart struct { // while values less than 1.0 result in a slower initial ramp-up followed by a // faster approach to the full weight (logarithmic). // - // Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - // Envoy uses its default of 1.0, which produces a linear ramp-up. + // This is expressed as a percentage-based integer where 100 represents 1.0, + // 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + // unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + // + // For example: + // - 50 => 0.5x + // - 100 => 1.0x + // - 150 => 1.5x + // - 200 => 2.0x // // +optional - // +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?|\.[0-9]+)$` - // +kubebuilder:validation:XValidation:rule="self != '0' && self != '0.0' && self != '.0'",message="aggression must be greater than 0" - Aggression *string `json:"aggression,omitempty"` + // +kubebuilder:validation:Minimum=1 + Aggression *uint32 `json:"aggression,omitempty"` // MinWeightPercent specifies the minimum percent of origin weight that avoids // too small new weight when an endpoint is in slow start window. This ensures diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index c04fa54455..d402ce8bc9 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -7727,7 +7727,7 @@ func (in *SlowStart) DeepCopyInto(out *SlowStart) { } if in.Aggression != nil { in, out := &in.Aggression, &out.Aggression - *out = new(string) + *out = new(uint32) **out = **in } if in.MinWeightPercent != nil { diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index d1fcbd30eb..ebd0cafc09 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -1058,13 +1058,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index 9ca7e9f2e4..549f864393 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1144,14 +1144,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml index 604b2f0733..24f843ce9e 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12461,15 +12461,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -14013,15 +14016,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -15726,15 +15732,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater - than 0 - rule: self != '0' && self != '0.0' - && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -17348,15 +17357,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && self - != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml index 39d5388386..1e5d565151 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1777,14 +1777,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -3200,14 +3204,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -4906,15 +4914,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && - self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -6624,14 +6635,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 66c3f7c33d..226404388e 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -1057,13 +1057,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index 593097cad6..3c119adce3 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1143,14 +1143,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml index 59a02ad80a..daf1c109f2 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12460,15 +12460,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -14012,15 +14015,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -15725,15 +15731,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater - than 0 - rule: self != '0' && self != '0.0' - && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -17347,15 +17356,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && self - != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml index 1a40f7ac14..ed0f9d9507 100644 --- a/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1776,14 +1776,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -3199,14 +3203,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -4905,15 +4913,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && - self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -6623,14 +6634,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/internal/gatewayapi/clustersettings.go b/internal/gatewayapi/clustersettings.go index 1b808612fe..1a24bca13b 100644 --- a/internal/gatewayapi/clustersettings.go +++ b/internal/gatewayapi/clustersettings.go @@ -12,7 +12,6 @@ import ( "math/big" "net/http" "reflect" - "strconv" "strings" "time" @@ -438,10 +437,7 @@ func buildSlowStart(slowStart *egv1a1.SlowStart) (*ir.SlowStart, error) { MinWeightPercent: slowStart.MinWeightPercent, } if slowStart.Aggression != nil { - aggression, err := strconv.ParseFloat(*slowStart.Aggression, 64) - if err != nil { - return nil, fmt.Errorf("invalid slowStart.aggression %q: %w", *slowStart.Aggression, err) - } + aggression := float64(*slowStart.Aggression) / 100 ret.Aggression = &aggression } return ret, nil diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml index 439895f55b..c99b46ec06 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml @@ -200,7 +200,7 @@ backendTrafficPolicies: type: LeastRequest slowStart: window: 300s - aggression: "1.5" + aggression: 150 minWeightPercent: 25 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: BackendTrafficPolicy diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml index 1c7fb30d19..045a80c518 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml @@ -42,7 +42,7 @@ backendTrafficPolicies: spec: loadBalancer: slowStart: - aggression: "1.5" + aggression: 150 minWeightPercent: 25 window: 300s type: LeastRequest diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 0bf17fe296..37c2884557 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -5657,7 +5657,7 @@ _Appears in:_ | Field | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `window` | _[Duration](https://gateway-api.sigs.k8s.io/reference/1.5/spec/#duration)_ | true | | Window defines the duration of the warm up period for newly added host.
During slow start window, traffic sent to the newly added hosts will gradually increase.
For additional details,
see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig | -| `aggression` | _string_ | false | | Aggression controls the speed at which the endpoint weight ramps up during the
slow start window. The endpoint weight is scaled by the time factor raised to
the power of (1 / aggression). Values greater than 1.0 result in a faster
initial ramp-up followed by a slower approach to the full weight (exponential),
while values less than 1.0 result in a slower initial ramp-up followed by a
faster approach to the full weight (logarithmic).
Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset,
Envoy uses its default of 1.0, which produces a linear ramp-up. | +| `aggression` | _integer_ | false | | Aggression controls the speed at which the endpoint weight ramps up during the
slow start window. The endpoint weight is scaled by the time factor raised to
the power of (1 / aggression). Values greater than 1.0 result in a faster
initial ramp-up followed by a slower approach to the full weight (exponential),
while values less than 1.0 result in a slower initial ramp-up followed by a
faster approach to the full weight (logarithmic).
This is expressed as a percentage-based integer where 100 represents 1.0,
150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If
unset, Envoy uses its default of 1.0, which produces a linear ramp-up.
For example:
- 50 => 0.5x
- 100 => 1.0x
- 150 => 1.5x
- 200 => 2.0x | | `minWeightPercent` | _integer_ | false | | MinWeightPercent specifies the minimum percent of origin weight that avoids
too small new weight when an endpoint is in slow start window. This ensures
that the EDF scheduler has a reasonable deadline. If unset, Envoy uses its
default of 10%. | diff --git a/test/cel-validation/backendtrafficpolicy_test.go b/test/cel-validation/backendtrafficpolicy_test.go index 8bd9476b94..e0c94331c2 100644 --- a/test/cel-validation/backendtrafficpolicy_test.go +++ b/test/cel-validation/backendtrafficpolicy_test.go @@ -586,7 +586,7 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { Type: egv1a1.RoundRobinLoadBalancerType, SlowStart: &egv1a1.SlowStart{ Window: ptr.To(gwapiv1.Duration("10ms")), - Aggression: ptr.To("1.5"), + Aggression: ptr.To[uint32](150), MinWeightPercent: ptr.To[uint32](25), }, }, @@ -613,35 +613,7 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { Type: egv1a1.RoundRobinLoadBalancerType, SlowStart: &egv1a1.SlowStart{ Window: ptr.To(gwapiv1.Duration("10ms")), - Aggression: ptr.To("0"), - }, - }, - }, - } - }, - wantErrors: []string{ - "aggression must be greater than 0", - }, - }, - { - desc: "roundrobin with non-numeric aggression is rejected", - mutate: func(btp *egv1a1.BackendTrafficPolicy) { - btp.Spec = egv1a1.BackendTrafficPolicySpec{ - PolicyTargetReferences: egv1a1.PolicyTargetReferences{ - TargetRef: &gwapiv1.LocalPolicyTargetReferenceWithSectionName{ - LocalPolicyTargetReference: gwapiv1.LocalPolicyTargetReference{ - Group: gwapiv1.Group("gateway.networking.k8s.io"), - Kind: gwapiv1.Kind("Gateway"), - Name: gwapiv1.ObjectName("eg"), - }, - }, - }, - ClusterSettings: egv1a1.ClusterSettings{ - LoadBalancer: &egv1a1.LoadBalancer{ - Type: egv1a1.RoundRobinLoadBalancerType, - SlowStart: &egv1a1.SlowStart{ - Window: ptr.To(gwapiv1.Duration("10ms")), - Aggression: ptr.To("fast"), + Aggression: ptr.To[uint32](0), }, }, }, diff --git a/test/helm/gateway-crds-helm/all.out.yaml b/test/helm/gateway-crds-helm/all.out.yaml index 30312432c5..31a35804b1 100644 --- a/test/helm/gateway-crds-helm/all.out.yaml +++ b/test/helm/gateway-crds-helm/all.out.yaml @@ -23585,13 +23585,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -29026,14 +29031,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -43352,15 +43361,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -44904,15 +44916,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -46617,15 +46632,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater - than 0 - rule: self != '0' && self != '0.0' - && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -48239,15 +48257,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && self - != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -51319,14 +51340,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -52742,14 +52767,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -54448,15 +54477,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && - self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -56166,14 +56198,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/test/helm/gateway-crds-helm/e2e.out.yaml b/test/helm/gateway-crds-helm/e2e.out.yaml index 80b11ff336..6524f734f6 100644 --- a/test/helm/gateway-crds-helm/e2e.out.yaml +++ b/test/helm/gateway-crds-helm/e2e.out.yaml @@ -1558,13 +1558,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -6999,14 +7004,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -21325,15 +21334,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -22877,15 +22889,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -24590,15 +24605,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater - than 0 - rule: self != '0' && self != '0.0' - && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -26212,15 +26230,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && self - != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -29292,14 +29313,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -30715,14 +30740,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -32421,15 +32450,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && - self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -34139,14 +34171,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids diff --git a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml index f87d07ccad..911e129491 100644 --- a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml +++ b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml @@ -1558,13 +1558,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -6999,14 +7004,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -21325,15 +21334,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -22877,15 +22889,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be - greater than 0 - rule: self != '0' && self != - '0.0' && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -24590,15 +24605,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater - than 0 - rule: self != '0' && self != '0.0' - && self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -26212,15 +26230,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && self - != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -29292,14 +29313,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -30715,14 +30740,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -32421,15 +32450,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than - 0 - rule: self != '0' && self != '0.0' && - self != '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids @@ -34139,14 +34171,18 @@ spec: while values less than 1.0 result in a slower initial ramp-up followed by a faster approach to the full weight (logarithmic). - Must be a positive decimal number (e.g. "1.0", "1.5", "2.0"). If unset, - Envoy uses its default of 1.0, which produces a linear ramp-up. - pattern: ^([0-9]+(\.[0-9]+)?|\.[0-9]+)$ - type: string - x-kubernetes-validations: - - message: aggression must be greater than 0 - rule: self != '0' && self != '0.0' && self != - '.0' + This is expressed as a percentage-based integer where 100 represents 1.0, + 150 represents 1.5, 50 represents 0.5, etc. Must be greater than 0. If + unset, Envoy uses its default of 1.0, which produces a linear ramp-up. + + For example: + - 50 => 0.5x + - 100 => 1.0x + - 150 => 1.5x + - 200 => 2.0x + format: int32 + minimum: 1 + type: integer minWeightPercent: description: |- MinWeightPercent specifies the minimum percent of origin weight that avoids From 4d362b342b7ff3da91cd7f1883b96e1c1553187b Mon Sep 17 00:00:00 2001 From: Adam Buran Date: Thu, 16 Apr 2026 21:04:46 -0700 Subject: [PATCH 3/3] fix(cel-validation): use new() instead of ptr.To to satisfy forbidigo lint Signed-off-by: Adam Buran --- test/cel-validation/backendtrafficpolicy_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/cel-validation/backendtrafficpolicy_test.go b/test/cel-validation/backendtrafficpolicy_test.go index e0c94331c2..f17c86b08a 100644 --- a/test/cel-validation/backendtrafficpolicy_test.go +++ b/test/cel-validation/backendtrafficpolicy_test.go @@ -585,9 +585,9 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { LoadBalancer: &egv1a1.LoadBalancer{ Type: egv1a1.RoundRobinLoadBalancerType, SlowStart: &egv1a1.SlowStart{ - Window: ptr.To(gwapiv1.Duration("10ms")), - Aggression: ptr.To[uint32](150), - MinWeightPercent: ptr.To[uint32](25), + Window: new(gwapiv1.Duration("10ms")), + Aggression: new(uint32(150)), + MinWeightPercent: new(uint32(25)), }, }, }, @@ -612,8 +612,8 @@ func TestBackendTrafficPolicyTarget(t *testing.T) { LoadBalancer: &egv1a1.LoadBalancer{ Type: egv1a1.RoundRobinLoadBalancerType, SlowStart: &egv1a1.SlowStart{ - Window: ptr.To(gwapiv1.Duration("10ms")), - Aggression: ptr.To[uint32](0), + Window: new(gwapiv1.Duration("10ms")), + Aggression: new(uint32(0)), }, }, },