Repository navigation
GEP-1619: Add Session Persistence API to Backend - #5298
kubernetes-prow[bot] merged 4 commits into
Conversation
|
This issue is currently awaiting triage. If Gateway API community members determine this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@rikatz @youngnick Ready for review - this is the implementation of #4876 which just merged with some mild GEP-4894 updates to reflect that. Hopefully a quick review. CC: @mikemorris @keithmattix FYI |
|
CC: @snorwin you may be interested too |
|
/cc |
|
/lgtm leaving approval for @robscott or @youngnick thanks! |
| // Support: Extended | ||
| // | ||
| // +optional | ||
| SessionPersistence *SessionPersistence `json:"sessionPersistence,omitempty"` |
There was a problem hiding this comment.
@gcs278 maybe I missed the discussion, but why do we only want session persistence for in-cluster and not for external backends?
There was a problem hiding this comment.
because you can't know what is your backend when you are on external hostnames.
There was a problem hiding this comment.
yea please correct if I'm missing something, but there is no explicit list of endpoints to be selected in the external hostname egress case.
Can there load balancing with egress? Sort of - I suppose a DNS record could have multiple IPs, which a gateway can potentially load balance to - however, that session persistence (e.g. like a cookie) should be established by the external egress service.
In egress, the local gateway is acting as the "client" - it feels like it's not the correct layer to initiate session persistence. It's equivalent to saying a browser should perform endpoint-level selection. Hence the limitation to in-cluster.
There was a problem hiding this comment.
On a somewhat related note, I think I'd prefer to have this be top level on the backend type and instead rely on CEL validation to determine what types of backend this is applicable to. It seems possible that in the future we may add other ways to refer to backends in a cluster, such as an objectRef, and moving this to the top level now would avoid the need for repeating it in multiple locations.
There was a problem hiding this comment.
@gcs278 I had exactly that case in mind, a transparent DNS where the client gets all endpoint IPs of a backend.
There was a problem hiding this comment.
Hmm that's fair. I'll move it up a level to be safe for future use cases.
It seems possible that in the future we may add other ways to refer to backends in a cluster, such as an objectRef
I suppose if you are saying that backend may refer to more than just endpointSelectors in the future - that's fair.
Pushed changes in the latest commit 51faf9d.
There was a problem hiding this comment.
Whoops sorry I found a bug that I previously introduced in backend, I have also fixed that in a separate commit. The +required marker on a inline field is causing failures requiring an empty string. Fixed in another commit.
7142379 to
cbe2739
Compare
51faf9d to
bffc347
Compare
3a5a3d5 to
698b82c
Compare
Implement Session Persistence API as described in kubernetes-sigs#4876 in Backend spec.endpointSelector. Update GEP-4894 to reflect Session Persistence is no longer future item.
Refactor SessionPersistence API to move to the top level of backend so that it can potentially be re-used with other object references of backend in the future. Use CEL to restrict it to EndpointSelector for now.
698b82c to
98a84a3
Compare
The spec.endpointSelector.labelSelector field was inlined and has no JSON property name which causes all objects to fail with invalid required: [""] error. The matchLabel field within labelSelector is already required, while the inlined struct should be optional.
98a84a3 to
1ceb033
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gcs278, robscott The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
- Update CEL to use ternary and CEL message - Fix double negative of API doc - Remove session persistence from GEP-4894
|
Thanks @gcs278! /lgtm |
What type of PR is this?
/kind gep
What this PR does / why we need it:
Implement Session Persistence API as described in #4876 in xBackend's
spec.endpointSelectorfield.Also, update GEP-4894 to reflect Session Persistence is no longer future item.
Which issue(s) this PR fixes:
Fixes # N/A
Related #4462 #4258
Does this PR introduce a user-facing change?:
Was AI used in preparing this PR?
/label ail/2