-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat(translator): Set zone for endpoint and arrange endpoints by zone in EDS #3542
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dingkang Li <dingkang1743@gmail.com>
LbEndpoints: endpoints, | ||
Priority: 0, | ||
// If irEp has unset zone, leave it empty. | ||
var zone string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks weight based routing, currently a setting has a weight, and there's 1:1 b/w xds locality and IR setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be fixed by copying the IR setting weight into lbEndpoint.LoadBalancingWeight
(currently set to 1) and removing the locality weight (or setting it to 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like splitting 1 backend with specific weight (as 1 IR setting) to multiple localities with same specific weight doesn't break weighted based routing.
Compared to your suggestion in which we assign the specific weight to individual endpoint, the same endpoint has same chance to be chosen by envoy.
Since EG has enabled locality weighted load balancing, we must set locality weight, or else the locality will not be assigned any load 1.
gateway/internal/xds/translator/cluster.go
Lines 85 to 89 in 85cac84
CommonLbConfig: &clusterv3.Cluster_CommonLbConfig{ | |
LocalityConfigSpecifier: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig_{ | |
LocalityWeightedLbConfig: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig{}, | |
}, | |
}, |
Footnotes
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3542 +/- ##
==========================================
- Coverage 68.81% 68.34% -0.47%
==========================================
Files 175 170 -5
Lines 21525 20770 -755
==========================================
- Hits 14812 14196 -616
+ Misses 5636 5556 -80
+ Partials 1077 1018 -59 ☔ View full report in Codecov by Sentry. |
/retest |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions! |
What this PR does / why we need it:
Set zone for endpoint and arrange endpoints by zone in EDS if zone is available in EndpointSlice. This is required before users can apply
priority levels
orzone aware routing
load balancing strategy.Which issue(s) this PR fixes:
Fixes #3538