Skip to content
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

GEP-1619: Enumerate common configuration for session persistence and affinity #1935

Merged

Conversation

gcs278
Copy link
Contributor

@gcs278 gcs278 commented Apr 14, 2023

What type of PR is this?
/kind gep

What this PR does / why we need it:
This update adds concrete configuration for session persistence and affinity to help lay a framework for future potential API design.

We are building iteratively on GEP-1619 by taking small steps towards a workable solution. This PR does not introduce concrete API design yet, but that is expected to come in the near future.

Review this GEP PR with Markdown Rendered: https://github.com/gcs278/gateway-api/blob/gep-1619-cookie-configuration/geps/gep-1619.md

Which issue(s) this PR fixes:
NONE

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/gep PRs related to Gateway Enhancement Proposal(GEP) cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 14, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @gcs278. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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/test-infra repository.

@youngnick
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 14, 2023
@shaneutt shaneutt self-requested a review April 14, 2023 22:14
@gcs278 gcs278 force-pushed the gep-1619-cookie-configuration branch 9 times, most recently from 733bc87 to dbf21e7 Compare April 25, 2023 17:12
@gcs278 gcs278 marked this pull request as ready for review April 25, 2023 17:20
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 25, 2023

Generally, the implementation API programs the dataplane API; however these two are not always clearly separated. The two types of APIs can use different API structures for configuring the same feature. Examining the dataplane APIs helps to remove the layer of API abstraction that implementations provide. Removing this layer avoids situations where implementations don’t fully implement all capabilities of a dataplane API or obfuscate certain configuration around session persistence. On the other hand, examining implementation APIs provides valuable data points in what implementations are interested in configuring.

**Session Persistence**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gcs278
Copy link
Contributor Author

gcs278 commented Apr 25, 2023

CC: @shaneutt @robscott @costinm @howardjohn @sunjayBhatia @pleshakov (the folks that showed interest in #1643 originally) ready for review if you happened to be interested in helping out. Thanks!

Copy link
Contributor

@youngnick youngnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an outstanding first pass at a GEP, and I will be pointing to it as such in the future.

I'll approve here with a hold so we can get some more LGTMs though.

/approve
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 25, 2023
@va7ish
Copy link

va7ish commented Apr 28, 2023

Actually session affinity/persistence is kind of related to "load balancing" - it is the exact opposite of load balancing. The goal is to keep sending requests (that match certain criteria) to a single backend instead of trying to balance load. So if all of the requests in a certain load balancer/proxy case have to obey the session persistence/affinity semantics then there is no (or very little) load balancing happening.

I wouldn't say its the exact opposite of load balancing. Rather its a two tier decision logic where we say 1) if we have a session identity provided in the request then route according to previous state/contract otherwise 2) Load balance as per LB configuration

@sanjaypujare
Copy link
Contributor

...
I wouldn't say its the exact opposite of load balancing. Rather its a two tier decision logic where we say 1) if we have a session identity provided in the request then route according to previous state/contract otherwise 2) Load balance as per LB configuration

I was trying to take a high level view in terms of the goal of each feature: a load balancer's goal is to spread (or "balance") the load among a set of backends (equally or based on some other criteria such as capacity) whereas the goal of a persistence/affinity feature is to not spread it but rather keep it stuck to one backend as far as possible.

We can model the behavior as you have described for the purpose of defining the API: if the policy dictates routing based on session identity then do it otherwise load balance based on some LB configuration.

@gcs278 gcs278 force-pushed the gep-1619-cookie-configuration branch from 4874c1f to df8eba0 Compare April 28, 2023 13:44
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this continues to be Provisional I'm personally comfortable with adding what's here and continuing to iterate from this point.

We should capture any outstanding concerns that aren't easily rectified yet as part of a TODO-type section.

@gcs278 gcs278 force-pushed the gep-1619-cookie-configuration branch from df8eba0 to 37d1851 Compare April 28, 2023 14:30
@gcs278
Copy link
Contributor Author

gcs278 commented Apr 28, 2023

We should capture any outstanding concerns that aren't easily rectified yet as part of a TODO-type section.

Added an additional open question in https://github.com/kubernetes-sigs/gateway-api/compare/df8eba0fa6ee7747822b0a6381016be541a6e21f..37d18517ea87f4b2271bad98e5f3436bf993b4af regarding discussion on API design.

Otherwise, I think our TODO section captures what we need todo. The biggest one being We need to design and document an API for session persistence and/or session affinity in the Gateway API spec. We'll tackle that in the next PR.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gcs278, this is really great. A few small requests but mostly LGTM.

### Open Questions

TBD
- Should we include both session persistence and session affinity API configurations in this GEP or just focus on session persistence?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gcs278 can you capture some of this context in the GEP before merging and link to this thread?

@shaneutt
Copy link
Member

shaneutt commented May 3, 2023

I like how Rob's review is from 14 hours ago, but the individual comments say last week. He wasn't kidding when he said he had a review in progress for a while that he just hadn't submitted yet 😂

@gcs278 gcs278 force-pushed the gep-1619-cookie-configuration branch 2 times, most recently from de756ff to c3c3fbb Compare May 3, 2023 17:51
@costinm
Copy link

costinm commented May 4, 2023 via email

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gcs278! A couple very tiny nits but these don't need to block merging.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gcs278, robscott, shaneutt, youngnick

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@youngnick
Copy link
Contributor

/lgtm

I'll leave the hold though until @gcs278 has a chance to address those nits.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2023
…affinity

- This update adds concrete configuration for session persistence and affinity
to help lay a framework for future potential API design
- Add additional open questions
- Add note on IP Address reuse in security & privacy section
- Add note about client application's role in session initiation
- Add helpful references
@gcs278 gcs278 force-pushed the gep-1619-cookie-configuration branch from c3c3fbb to 1b09832 Compare May 4, 2023 13:38
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2023
@robscott
Copy link
Member

robscott commented May 4, 2023

Thanks @gcs278!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2023
@robscott
Copy link
Member

robscott commented May 4, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 4, 2023
@k8s-ci-robot k8s-ci-robot merged commit a63c912 into kubernetes-sigs:main May 4, 2023
@youngnick
Copy link
Contributor

Noone ever mentioned #1619 to create the link, sigh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/gep PRs related to Gateway Enhancement Proposal(GEP) lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants