Skip to content

feat(translator): Set zone for endpoint and arrange endpoints by zone in EDS - #3542

Closed
aoledk wants to merge 6 commits into
envoyproxy:mainfrom
aoledk:set-zone-for-endpoint
Closed

aoledk wants to merge 6 commits into
envoyproxy:mainfrom
aoledk:set-zone-for-endpoint

Conversation

@aoledk

@aoledk aoledk commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

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 or zone aware routing load balancing strategy.

Which issue(s) this PR fixes:

Fixes #3538

@aoledk
aoledk requested a review from a team as a code owner June 5, 2024 08:30
LbEndpoints: endpoints,
Priority: 0,
// If irEp has unset zone, leave it empty.
var zone string

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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)

Copy link
Copy Markdown
Contributor Author

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.

CommonLbConfig: &clusterv3.Cluster_CommonLbConfig{
LocalityConfigSpecifier: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig_{
LocalityWeightedLbConfig: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig{},
},
},

Footnotes

  1. https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint_components.proto#config-endpoint-v3-localitylbendpoints ↩

@codecov

codecov Bot commented Jun 6, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.34%. Comparing base (4a74e60) to head (026f29f).

❗ Current head 026f29f differs from pull request most recent head eba8f1c

Please upload reports for the commit eba8f1c to get more accurate results.

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.
📢 Have feedback on the report? Share it here.

@aoledk

aoledk commented Jun 6, 2024

Copy link
Copy Markdown
Contributor Author

/retest

@aoledk
aoledk marked this pull request as draft July 1, 2024 02:21
@github-actions

github-actions Bot commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

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!

@github-actions github-actions Bot added the stale label Aug 2, 2024
@arkodg

arkodg commented May 23, 2025

Copy link
Copy Markdown
Contributor

closing this PR since its become inactive, Zone aware routing is now available on v1.4.0

@arkodg arkodg closed this May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set zone from EndpointSlice for xDS Endpoint

2 participants