-
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: support LB priority for non xRoute endpoints #4033
Conversation
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4033 +/- ##
==========================================
+ Coverage 67.87% 67.92% +0.05%
==========================================
Files 187 187
Lines 23023 23030 +7
==========================================
+ Hits 15626 15644 +18
+ Misses 6277 6271 -6
+ Partials 1120 1115 -5 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
/retest |
2 similar comments
/retest |
/retest |
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
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.
Can we also add an XDS translation test?
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
/retest |
added |
/retest |
added |
overall LGTM. cc @arkodg In terms of naming, I think that failover is a common industry term used by Akamai, Cloudflare, GCP, AWS and Azure in this context. Nginx and HAProxy use "backup". I think that "backup" can be a bit vague in this context:
We need to follow up with an E2E and user docs that explain how priorities interact with Active/Passive healthchecks and discovery. |
/retest |
Co-authored-by: zirain <zirain2009@gmail.com> Signed-off-by: Alex Volchok <alex.volchok@sap.com>
/retest |
api/v1alpha1/shared_types.go
Outdated
@@ -473,6 +473,10 @@ type BackendRef struct { | |||
// BackendObjectReference references a Kubernetes object that represents the backend. | |||
// Only Service kind is supported for now. | |||
gwapiv1.BackendObjectReference `json:",inline"` | |||
// Failover This indicates whether the backend is designated as a failover. | |||
// Multiple failover backends can be configured for a single BackendService. |
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.
// Multiple failover backends can be configured for a single BackendService. | |
// Multiple failover backends can be configured. |
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.
updated
@@ -473,6 +473,10 @@ type BackendRef struct { | |||
// BackendObjectReference references a Kubernetes object that represents the backend. | |||
// Only Service kind is supported for now. | |||
gwapiv1.BackendObjectReference `json:",inline"` | |||
// Failover This indicates whether the backend is designated as a failover. | |||
// Multiple failover backends can be configured for a single BackendService. | |||
// +optional |
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.
"Its strongly recommended to configure active or passive healthchecks to ensure failover can be detected when the active backends are unhealthy and can be readjusted once the primary backends are healthy again. The overprovisioning factor is set to 1.4 i.e. the failover backends will receive traffic only once the health of the active backends drops below 72%"
@@ -851,7 +854,7 @@ func (t *Translator) buildExtAuth(policy *egv1a1.SecurityPolicy, resources *Reso | |||
authority = backendRefAuthority(resources, backendRef, policy) | |||
pnn := utils.NamespacedName(policy) | |||
if ds, err = t.processExtServiceDestination( | |||
backendRef, | |||
&egv1a1.BackendRef{BackendObjectReference: *backendRef, Failover: priority}, |
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.
can we modify this to Failover: ptr.Deref(grpc.BackendRefs[0].Failover , false)
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 line is typecasting from bool from int32 ? can we make it more explicit, no strong preference on using bool or int in IR
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.
we don't have to type cast (its bool type both in ir/ api), priority var should be renamed failover in this context
Signed-off-by: Alexander Volchok <alex.volchok@sap.com>
/retest |
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.
LGTM thanks !
/retest |
/retest |
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>
What does this PR do?
It enables users to configure failover backends.
How is this achieved?
The proposal involves adding a Failover boolean property to backend refs, what allows to indicate whether the backend is designated as a failover.
This approach is illustrated in this PR for external extProc.
As per issue #3055