-
Notifications
You must be signed in to change notification settings - Fork 810
api: add zoneAware lb config #6154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 35 commits
73b3138
12c2de1
4658c0f
36210d4
d0d1373
b5df7fa
d2494c9
771067d
b011bfd
c92ee26
bea63f3
e66c0e1
23077f3
99ecbc4
eaa0303
3efea14
657f9b0
6865853
daf1045
e7d5ccc
9777899
d81d1a6
c494040
a41d91a
2259c52
1e8ad66
230c7ab
66116a2
8bce345
45ea6d2
69c9844
47de9b2
af59d2e
a0acfb1
ed66bf7
6490978
54b57f1
4d26526
f716197
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
| // | ||
| // +kubebuilder:validation:XValidation:rule="self.type == 'ConsistentHash' ? has(self.consistentHash) : !has(self.consistentHash)",message="If LoadBalancer type is consistentHash, consistentHash field needs to be set." | ||
| // +kubebuilder:validation:XValidation:rule="self.type in ['Random', 'ConsistentHash'] ? !has(self.slowStart) : true ",message="Currently SlowStart is only supported for RoundRobin and LeastRequest load balancers." | ||
| // +kubebuilder:validation:XValidation:rule="self.type == 'ConsistentHash' ? !has(self.zoneAware) : true ",message="Currently ZoneAware is only supported for LeastRequest, Random, and RoundRobin load balancers." | ||
| type LoadBalancer struct { | ||
| // Type decides the type of Load Balancer policy. | ||
| // Valid LoadBalancerType values are | ||
|
|
@@ -34,6 +35,12 @@ type LoadBalancer struct { | |
| // | ||
| // +optional | ||
| SlowStart *SlowStart `json:"slowStart,omitempty"` | ||
|
|
||
| // ZoneAware defines the configuration related to the distribution of requests between locality zones. | ||
| // | ||
| // +optional | ||
| // +notImplementedHide | ||
| ZoneAware *ZoneAware `json:"zoneAware,omitempty"` | ||
| } | ||
|
|
||
| // LoadBalancerType specifies the types of LoadBalancer. | ||
|
|
@@ -135,3 +142,39 @@ type SlowStart struct { | |
| Window *metav1.Duration `json:"window"` | ||
| // TODO: Add support for non-linear traffic increases based on user usage. | ||
| } | ||
|
|
||
| // ZoneAware defines the configuration related to the distribution of requests between localities. | ||
| type ZoneAware struct { | ||
| // PreferLocalZone configures zone-aware routing to prefer sending traffic to the local locality zone. | ||
| // | ||
| // +optional | ||
| // +notImplementedHide | ||
| PreferLocal *PreferLocalZone `json:"preferLocal,omitempty"` | ||
| } | ||
|
|
||
| // PreferLocalZone configures zone-aware routing to prefer sending traffic to the local locality zone. | ||
| type PreferLocalZone struct { | ||
| // ForceLocalZone defines override configuration for forcing all traffic to stay local instead of the default behavior | ||
| // which maintains equal distribution among upstream endpoints while sending as much traffic as possible locally. | ||
| // | ||
| // +optional | ||
| // +notImplementedHide | ||
| Force *ForceLocalZone `json:"force,omitempty"` | ||
|
|
||
| // MinEndpointsCount is the minimum number of total upstream endpoints across all zones required to enable zone-aware routing. | ||
| // | ||
| // +optional | ||
| // +notImplementedHide | ||
| MinEndpointsCount *uint64 `json:"minEndpointsCount,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thoughts on MinEndpointsThreshold ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wdyt @envoyproxy/gateway-maintainers
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency, IMO we should align the naming of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's what I had assumed and changed both to use "Threshold" |
||
| } | ||
|
|
||
| // ForceLocalZone defines override configuration for forcing all traffic to stay local vs Envoy default behavior | ||
| // which maintains equal distribution among upstreams while sending as much traffic as possible locally. | ||
| type ForceLocalZone struct { | ||
| // MinEndpointsInZoneCount is the minimum number of upstream endpoints in the local zone required to honor the forceLocalZone | ||
| // override. This is useful for protecting zones with fewer endpoints. | ||
| // | ||
| // +optional | ||
| // +notImplementedHide | ||
| MinEndpointsInZoneCount *uint32 `json:"minEndpointsInZoneCount,omitempty"` | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.