-
Notifications
You must be signed in to change notification settings - Fork 400
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
Locality Based Routing Support #1909
Comments
Hey @tanujd11 from a user perspective can you share what you like to happen on the data plane ( from gateway to multiple backend endpoints with different topology info ) |
I understand this is very useful for optimizing East West traffic within a cluster, is that also the case for north South ? |
I think for an Envoy gateway running in us-east-1/us-east-1a should prefer the same zone backend to prevent cross zonal traffic. I think this behaviour could be made as default as cross zone communication is obviously costly. WDYT? |
thanks, here's something more to think about
|
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
there's a new field in the Service spec (trafficDistribution.preferClose) https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution that we could consider using to automate priority amongst endpoints within a Service |
Could be an option when this new field is stable and corresponding K8s version is adopted by massive companies. Before that, IMO it's better to do load balancing accross endpoints in the cluster via Envoy's capability. Currently EG has implemented locality weighted load balancing 1, one locality := &endpointv3.LocalityLbEndpoints{
Locality: &corev3.Locality{
Region: fmt.Sprintf("%s/backend/%d", clusterName, i),
},
LbEndpoints: endpoints,
Priority: 0,
}
// Set locality weight
var weight uint32
if ds.Weight != nil {
weight = *ds.Weight
} else {
weight = 1
} Actually endpoints inside a Through Envoy's capability, priority levels 2 or zone aware routing 3 4 can archive the goal to save cross zone cost. priority levels
zone aware routing
personal preferenceSince step 1 and 2 is required by both, priority levels can work with implemented locality weighed load balancing, but zone aware routing can't. Apparently priority levels are easier to implement. But it requires EDS resources should be arranged in Footnotes
|
thanks for outlining the steps @aoledk ! we currently have #3055 open to get explicit priority per backendRef and program that into the xds cluster resource. In the future, we can use this issue to make sure we track the auto priority work, the field in k8s |
Hi @aoledk, regarding:
Is this option viable? Can our XDS server produce different EDS for different envoy pods that are part of the same Envoy deployment? |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
Hi @aoledk! Are you still looking into implementing it yourself? If not, I’m interested in this feature and can work on bringing it to life. |
@flyik recently I'm busy with bringing in EG, you can go ahead. |
@flyik I've unassigned myself, you can assign to yourself. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
keep |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
keep |
Is anyone working on this who would like to collaborate? I'm interested in support for both Traffic Distribution and Topology Aware Routing |
thanks @jukie assigning this one to you. |
@arkodg wouldn't opting in via the Kubernetes Service annotation ( Updating getIREndpointsFromEndpointSlice() and The approach I thought of was to include the |
I think there are two parts here
I was referring to 1. to be opt in, in case setting those fields has an impact on common case performance, and might affect users not interested in the feature, and if it isn't, default is fine |
Hi! Will there be an option to choose between Zone-Aware Routing and Locality-Weighted Load Balancing in the future? It looks like the approach with priorities has a lot to offer—starting with more than one "layer" for balancing (region/zone/subzone vs. just zone in the case of ZAR), the ability to manually set fallback locations, and the option to specify weights across them. |
@flyik yes, my PR is still very much WIP but the end result won't hardcode one or the other like it does currently. |
From the contributors call it sounds like there's a strong preference against adding a Mutating Webhook so I was curious if anyone has another suggestion for how to handle zone discovery from the envoy proxy instances. An initContainer is the other option I had in mind. The challenge is that we can't use downwardAPI to share underlying node topology labels and inject as an env var for example so we'll need something else to populate the |
thanks for digging into this @jukie, +1 to the init container approach of injecting an env var and reusing it in the proxy container |
Is anyone interested in owning that piece of work? That can happen separately from my PR and would amount to the goal of getting the envoy proxy instances launched with |
sure @jukie feel free to create a GH issue or subtask for it, and someone else from the community can pick that piece up |
Description:
Implement locality based routing support by default in EG. Now that we we can have individual endpoints as backend to EG. Can we support region/zone/subzone based routing based on EndpointSlice information, node labels etc.?
The text was updated successfully, but these errors were encountered: