Skip to content

Commit 78380e4

Browse files
authored
feat: Add BackendUtilization + WeightedZones support (WrrLocality Lb policy) (#8634)
* Add BackendUtilization + WeightedZones support (WrrLocality Lb policy) Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * regen Signed-off-by: jukie <10012479+jukie@users.noreply.github.com> * Merge branch 'main' into wrr-locality-support Signed-off-by: jukie <10012479+jukie@users.noreply.github.com> * Fix CEL and add examples Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * Update docs Signed-off-by: jukie <10012479+jukie@users.noreply.github.com> * Adjust warmup logic Signed-off-by: jukie <10012479+jukie@users.noreply.github.com> * remove ptr usage Signed-off-by: jukie <10012479+jukie@users.noreply.github.com> --------- Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
1 parent f394346 commit 78380e4

33 files changed

Lines changed: 2169 additions & 238 deletions

File tree

api/v1alpha1/loadbalancer_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818
// +kubebuilder:validation:XValidation:rule="self.type == 'DynamicModule' ? has(self.dynamicModule) : !has(self.dynamicModule)",message="If LoadBalancer type is DynamicModule, dynamicModule field needs to be set."
1919
// +kubebuilder:validation:XValidation:rule="self.type in ['Random', 'ConsistentHash', 'DynamicModule'] ? !has(self.slowStart) : true",message="Currently SlowStart is only supported for RoundRobin, LeastRequest, and BackendUtilization load balancers."
2020
// +kubebuilder:validation:XValidation:rule="self.type == 'ConsistentHash' && has(self.zoneAware) ? !has(self.zoneAware.preferLocal) : true",message="PreferLocal zone-aware routing is not supported for ConsistentHash load balancers. Use weightedZones instead."
21-
// +kubebuilder:validation:XValidation:rule="self.type in ['BackendUtilization', 'DynamicModule'] ? !has(self.zoneAware) : true",message="ZoneAware routing is not supported for BackendUtilization and DynamicModule load balancers."
21+
// +kubebuilder:validation:XValidation:rule="self.type == 'BackendUtilization' && has(self.zoneAware) ? !has(self.zoneAware.preferLocal) : true",message="PreferLocal zone-aware routing is not currently supported for BackendUtilization load balancers. Only WeightedZones can be used with BackendUtilization."
22+
// +kubebuilder:validation:XValidation:rule="self.type == 'DynamicModule' ? !has(self.zoneAware) : true",message="ZoneAware routing is not supported for DynamicModule load balancers."
2223
// +kubebuilder:validation:XValidation:rule="has(self.zoneAware) ? !(has(self.zoneAware.preferLocal) && has(self.zoneAware.weightedZones)) : true",message="ZoneAware PreferLocal and WeightedZones cannot be specified together."
2324
// +kubebuilder:validation:XValidation:rule="self.type == 'DynamicModule' ? !has(self.endpointOverride) : true",message="EndpointOverride is not supported for DynamicModule load balancers."
2425
type LoadBalancer struct {

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,10 +1170,14 @@ spec:
11701170
load balancers. Use weightedZones instead.
11711171
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware) ?
11721172
!has(self.zoneAware.preferLocal) : true'
1173-
- message: ZoneAware routing is not supported for BackendUtilization
1174-
and DynamicModule load balancers.
1175-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
1176-
? !has(self.zoneAware) : true'
1173+
- message: PreferLocal zone-aware routing is not currently supported
1174+
for BackendUtilization load balancers. Only WeightedZones can
1175+
be used with BackendUtilization.
1176+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
1177+
? !has(self.zoneAware.preferLocal) : true'
1178+
- message: ZoneAware routing is not supported for DynamicModule load
1179+
balancers.
1180+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware) : true'
11771181
- message: ZoneAware PreferLocal and WeightedZones cannot be specified
11781182
together.
11791183
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal) &&

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,10 +1259,15 @@ spec:
12591259
instead.
12601260
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
12611261
? !has(self.zoneAware.preferLocal) : true'
1262-
- message: ZoneAware routing is not supported for BackendUtilization
1263-
and DynamicModule load balancers.
1264-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
1265-
? !has(self.zoneAware) : true'
1262+
- message: PreferLocal zone-aware routing is not currently
1263+
supported for BackendUtilization load balancers. Only
1264+
WeightedZones can be used with BackendUtilization.
1265+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
1266+
? !has(self.zoneAware.preferLocal) : true'
1267+
- message: ZoneAware routing is not supported for DynamicModule
1268+
load balancers.
1269+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
1270+
: true'
12661271
- message: ZoneAware PreferLocal and WeightedZones cannot
12671272
be specified together.
12681273
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12588,12 +12588,17 @@ spec:
1258812588
rule: 'self.type == ''ConsistentHash''
1258912589
&& has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
1259012590
: true'
12591-
- message: ZoneAware routing is not supported
12592-
for BackendUtilization and DynamicModule
12593-
load balancers.
12594-
rule: 'self.type in [''BackendUtilization'',
12595-
''DynamicModule''] ? !has(self.zoneAware)
12591+
- message: PreferLocal zone-aware routing
12592+
is not currently supported for BackendUtilization
12593+
load balancers. Only WeightedZones
12594+
can be used with BackendUtilization.
12595+
rule: 'self.type == ''BackendUtilization''
12596+
&& has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
1259612597
: true'
12598+
- message: ZoneAware routing is not supported
12599+
for DynamicModule load balancers.
12600+
rule: 'self.type == ''DynamicModule''
12601+
? !has(self.zoneAware) : true'
1259712602
- message: ZoneAware PreferLocal and WeightedZones
1259812603
cannot be specified together.
1259912604
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)
@@ -14114,12 +14119,17 @@ spec:
1411414119
rule: 'self.type == ''ConsistentHash''
1411514120
&& has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
1411614121
: true'
14117-
- message: ZoneAware routing is not supported
14118-
for BackendUtilization and DynamicModule
14119-
load balancers.
14120-
rule: 'self.type in [''BackendUtilization'',
14121-
''DynamicModule''] ? !has(self.zoneAware)
14122+
- message: PreferLocal zone-aware routing
14123+
is not currently supported for BackendUtilization
14124+
load balancers. Only WeightedZones
14125+
can be used with BackendUtilization.
14126+
rule: 'self.type == ''BackendUtilization''
14127+
&& has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
1412214128
: true'
14129+
- message: ZoneAware routing is not supported
14130+
for DynamicModule load balancers.
14131+
rule: 'self.type == ''DynamicModule''
14132+
? !has(self.zoneAware) : true'
1412314133
- message: ZoneAware PreferLocal and WeightedZones
1412414134
cannot be specified together.
1412514135
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)
@@ -15798,11 +15808,16 @@ spec:
1579815808
rule: 'self.type == ''ConsistentHash'' &&
1579915809
has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
1580015810
: true'
15811+
- message: PreferLocal zone-aware routing is
15812+
not currently supported for BackendUtilization
15813+
load balancers. Only WeightedZones can be
15814+
used with BackendUtilization.
15815+
rule: 'self.type == ''BackendUtilization''
15816+
&& has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
15817+
: true'
1580115818
- message: ZoneAware routing is not supported
15802-
for BackendUtilization and DynamicModule
15803-
load balancers.
15804-
rule: 'self.type in [''BackendUtilization'',
15805-
''DynamicModule''] ? !has(self.zoneAware)
15819+
for DynamicModule load balancers.
15820+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
1580615821
: true'
1580715822
- message: ZoneAware PreferLocal and WeightedZones
1580815823
cannot be specified together.
@@ -17389,10 +17404,15 @@ spec:
1738917404
instead.
1739017405
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
1739117406
? !has(self.zoneAware.preferLocal) : true'
17407+
- message: PreferLocal zone-aware routing is not currently
17408+
supported for BackendUtilization load balancers.
17409+
Only WeightedZones can be used with BackendUtilization.
17410+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
17411+
? !has(self.zoneAware.preferLocal) : true'
1739217412
- message: ZoneAware routing is not supported for
17393-
BackendUtilization and DynamicModule load balancers.
17394-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
17395-
? !has(self.zoneAware) : true'
17413+
DynamicModule load balancers.
17414+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
17415+
: true'
1739617416
- message: ZoneAware PreferLocal and WeightedZones
1739717417
cannot be specified together.
1739817418
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,10 +1894,15 @@ spec:
18941894
instead.
18951895
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
18961896
? !has(self.zoneAware.preferLocal) : true'
1897-
- message: ZoneAware routing is not supported for BackendUtilization
1898-
and DynamicModule load balancers.
1899-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
1900-
? !has(self.zoneAware) : true'
1897+
- message: PreferLocal zone-aware routing is not currently
1898+
supported for BackendUtilization load balancers. Only
1899+
WeightedZones can be used with BackendUtilization.
1900+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
1901+
? !has(self.zoneAware.preferLocal) : true'
1902+
- message: ZoneAware routing is not supported for DynamicModule
1903+
load balancers.
1904+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
1905+
: true'
19011906
- message: ZoneAware PreferLocal and WeightedZones cannot
19021907
be specified together.
19031908
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)
@@ -3292,10 +3297,15 @@ spec:
32923297
instead.
32933298
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
32943299
? !has(self.zoneAware.preferLocal) : true'
3295-
- message: ZoneAware routing is not supported for BackendUtilization
3296-
and DynamicModule load balancers.
3297-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
3298-
? !has(self.zoneAware) : true'
3300+
- message: PreferLocal zone-aware routing is not currently
3301+
supported for BackendUtilization load balancers. Only
3302+
WeightedZones can be used with BackendUtilization.
3303+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
3304+
? !has(self.zoneAware.preferLocal) : true'
3305+
- message: ZoneAware routing is not supported for DynamicModule
3306+
load balancers.
3307+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
3308+
: true'
32993309
- message: ZoneAware PreferLocal and WeightedZones cannot
33003310
be specified together.
33013311
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)
@@ -4976,10 +4986,17 @@ spec:
49764986
Use weightedZones instead.
49774987
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
49784988
? !has(self.zoneAware.preferLocal) : true'
4989+
- message: PreferLocal zone-aware routing is not
4990+
currently supported for BackendUtilization load
4991+
balancers. Only WeightedZones can be used with
4992+
BackendUtilization.
4993+
rule: 'self.type == ''BackendUtilization'' &&
4994+
has(self.zoneAware) ? !has(self.zoneAware.preferLocal)
4995+
: true'
49794996
- message: ZoneAware routing is not supported for
4980-
BackendUtilization and DynamicModule load balancers.
4981-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
4982-
? !has(self.zoneAware) : true'
4997+
DynamicModule load balancers.
4998+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
4999+
: true'
49835000
- message: ZoneAware PreferLocal and WeightedZones
49845001
cannot be specified together.
49855002
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)
@@ -6665,10 +6682,15 @@ spec:
66656682
instead.
66666683
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware)
66676684
? !has(self.zoneAware.preferLocal) : true'
6668-
- message: ZoneAware routing is not supported for BackendUtilization
6669-
and DynamicModule load balancers.
6670-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
6671-
? !has(self.zoneAware) : true'
6685+
- message: PreferLocal zone-aware routing is not currently
6686+
supported for BackendUtilization load balancers. Only
6687+
WeightedZones can be used with BackendUtilization.
6688+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
6689+
? !has(self.zoneAware.preferLocal) : true'
6690+
- message: ZoneAware routing is not supported for DynamicModule
6691+
load balancers.
6692+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware)
6693+
: true'
66726694
- message: ZoneAware PreferLocal and WeightedZones cannot
66736695
be specified together.
66746696
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal)

charts/gateway-helm/charts/crds/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,10 +1169,14 @@ spec:
11691169
load balancers. Use weightedZones instead.
11701170
rule: 'self.type == ''ConsistentHash'' && has(self.zoneAware) ?
11711171
!has(self.zoneAware.preferLocal) : true'
1172-
- message: ZoneAware routing is not supported for BackendUtilization
1173-
and DynamicModule load balancers.
1174-
rule: 'self.type in [''BackendUtilization'', ''DynamicModule'']
1175-
? !has(self.zoneAware) : true'
1172+
- message: PreferLocal zone-aware routing is not currently supported
1173+
for BackendUtilization load balancers. Only WeightedZones can
1174+
be used with BackendUtilization.
1175+
rule: 'self.type == ''BackendUtilization'' && has(self.zoneAware)
1176+
? !has(self.zoneAware.preferLocal) : true'
1177+
- message: ZoneAware routing is not supported for DynamicModule load
1178+
balancers.
1179+
rule: 'self.type == ''DynamicModule'' ? !has(self.zoneAware) : true'
11761180
- message: ZoneAware PreferLocal and WeightedZones cannot be specified
11771181
together.
11781182
rule: 'has(self.zoneAware) ? !(has(self.zoneAware.preferLocal) &&

0 commit comments

Comments
 (0)