-
Notifications
You must be signed in to change notification settings - Fork 347
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
Support LB priority for endpoints #3055
Comments
ideally prefer if this was in upstream |
Yes, also ext-proc. I don't object, and this is in-line with gateway-api. Do you think that we should consider a different intermediate approach? |
I'd vote to pluraize the backendRefs for non xRoute asap while we are in alpha, which can be a good place to test the |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
This could be used to solve #1909, though it may require further refinement. Specifically, the Envoy Gateway should allocate distinct priority levels to the same upstream endpoint, varying by the Envoy Pod’s location in different availability zones. For instance, for an identical endpoint in zone A, the Envoy Pod situated in zone A should be assigned priority 0, whereas Envoy Pods in zones B and C should be assigned priority 1. Do you think Envoy Gateway will handle this? Or leave it to the user? |
We briefly discussed this scenario in the community meeting. It seems like this will require pushing different config to different envoy proxies based on zone information. For the time being, we'll focus on supporting the simpler use case described above. |
As mentioned in #1909 (comment), Envoy in different zones may use same backend endpoint as different priority to reduce cross-zone cost. It's a required feature for production adoption. Does community have roadmap on this feature ? |
#1909 (comment) says:
@arkodg One backendRef (mainly Service) will refer to endpoints from multiple zones, priority should not be applied on backendRef, unless we use selector to collect endpoints in same zone into single backendRef. Besides, same endpoint will have different priority in Envoy. So maybe we can't assign a fixed priority for backendRef, codes will be needed to assign right priority for specific Envoy. |
there are two use cases for priority
|
@arkodg Can we add a new xDS Hook API, like |
@arkodg I've quoted your #3538 (comment) here to continue discussion about priority. I'll freeze #3542 until we reach agreement. Assuming two cases demonstrated in image below. Case A: priority isn't in gateway-api, EG will generate Case B: priority is in gateway-api, EG will generate Code in gateway/internal/xds/cache/snapshotcache.go Lines 92 to 96 in 33fceb0
We can have 2 options to enable topology aware routing ( NOT envoy zone aware routing ) based on priority. Option 1Add knob into BackendTrafficPolicy to enable topology aware routing for affected BackendRefs. If we enable in Case A,
If we enable in Case B,
But this option has several challenges. Challenge 1The new knob is accessible in Challenge 2Should we allow user to enable topology aware routing for BackendRefs specified with priority ? If yes, that means Option 2Add knob into EnvoyGateway to enable topology aware routing for all BackendRefs. If enabled,
Challenge 1Same to Option 1's Challenge 2.
LocalityLbEndpoints can be set with
Envoy can be set with
So |
thanks for the detailed analysis @aoledk !
Auto Zone Aware Routing
As next steps, here is what I propose
|
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
1 sounds straight forward and can bring value, we can extend this struct with an endpoint priority field: gateway/api/v1alpha1/shared_types.go Line 471 in a43cc6c
Similar to how gwapiv1.BackendObjectReference has "weight". Then, translate this value to an envoy endpoint priority: We can also have an E2E test for this, to demonstrate that when a high-prio backend is down, traffic is steered to the low prio backend. This will only work for "technical" backends at the moment, like ext-auth/proc/observability sinks ... If the direction sounds good, I can get started with adding it? |
hey @alexwo thanks for lookiing into this ! note for @aoledk who is looking into Zone Aware Routing, priority routing is mutually exclusive to it, and EG should be able to do zone aware routing for P=0 Hosts |
GCP expresses failover using a |
Sure, we can simplify and offer the same level of flexibility as done in GCP. So that via the API layer we expose just a boolean and manage as priority at the translation layer, allowing for a priority of: primary / backup (0,1). |
nginx has a I'm a +1 for the boolean option also @alexwo another design decision is around when does an endpoint get removed from the load balancing pool and when does it get re added ? is the user responsible for setting up |
+1 for a boolean as well.
|
Adds a `failover` field to Backend API so we can support Active/Passive Failove backends within xRoutes similar to envoyproxy#4033 Relates to envoyproxy#3055 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
* [api] Add Failover field to Backend Adds a `failover` field to Backend API so we can support Active/Passive Failove backends within xRoutes similar to #4033 Relates to #3055 Signed-off-by: Arko Dasgupta <arko@tetrate.io> * fix doc string Signed-off-by: Arko Dasgupta <arko@tetrate.io> * notImplementedHide Signed-off-by: Arko Dasgupta <arko@tetrate.io> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io>
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
Relates to envoyproxy#3055 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
* feat: implement fallback for the Backend API Relates to #3055 Signed-off-by: Arko Dasgupta <arko@tetrate.io> * fix lint Signed-off-by: Arko Dasgupta <arko@tetrate.io> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io>
docs and e2e is left, moving this to the v1.2.0 milestone |
Description:
Envoy supports routing priorities:
This allows users to configure a failover mechanism from primary to secondary endpoints.
Envoy Gateway currently configures a default priority for all endpoints:
gateway/internal/xds/translator/cluster.go
Line 408 in f9409e4
LB Priority can be implemented by extending existing Gateway-API resource:
BackendRefs
may support a priority field, similar to the existing weight field.BackendLBPolicy
resource may be extended to support additional LB considerations, such as priorty.Other options:
BackendTrafficPolicy
can be used to assign priorities. For example, the policy will hold a map of BackendRefs to priorities. Or, the policy can attach directly to Service resources.The text was updated successfully, but these errors were encountered: