-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Proposal: Revision attribute for instance session affinity #9039
Comments
/area networking cc @tcnghia @nak3 @ZhiminXiang I think it's probably prudent to defer API discussions to after we've nailed down the semantics. We basically provide zero guarantees today that a Pod even continues to exist outside the bounds of a request. There are also a wide variety of gotchas here:
I could see configuring the networking layer to try to prefer these sorts of things even without API changes, but "best effort" and "conformance" don't really mix for me. I'd love to hear others thoughts. |
My intuition: this is best effort affinity.
|
Yep, I think I covered 1. and 2. in the proposal: Of course If the instance is rebooted, unhealthy, overloaded or becomes unavailable when the number of instances has been scaled down, session affinity will be broken and further requests are then routed to a different instance. |
My concern is the subjectivity of the semantics you're describing. How do we know if an implementation implements this properly or regresses? What's to stop me from claiming we do this today and just suck! 😉 I am guessing you're after Envoy's cookie semantics, which is already available in Istio and Contour (at least), but we have a process that needs to be followed to leverage new networking features in our public API surface. Especially since we have a non-Envoy-based implementation. My chief concern is being able to test the semantics, but a close second is how we preserve those semantics with the activator (which isn't Envoy-based either) on the dataplane. cc @tcnghia @nak3 @ZhiminXiang (for networking) I'd guess those are both solvable problems, but it's worth resolving them before we get too deep into the process above (or talk about the API surface). |
Oh, another important element that I forgot, which is pretty key to our expansion principles: Is this possible in Ingress v2? |
Given the failure modes I don't understand why you wouldn't want to move your session state persistence to some external service - ie. memcache, redis, apache gemfire ie. if you're using spring there's tooling that abstracts this |
In Ingress v2, it seems to be under discussion. (cc @hbagdi ) |
This issue is stale because it has been open for 90 days with no |
/lifecycle frozen |
It looks like this is under discussion, but needs a concrete proposal which would explain how it fits with the different networking implementations (and how it fits with other features like traffic splits). If we want to make this part of the specification, we'd also need a way to express conformance. /triage accepted |
Closing as dupe of #8160 |
/area API
/kind spec
Summary
Add a Revision-level attribute to enable session affinity to container instances.
Use cases:
Proposal
Introduce a new revision level attribute (e.g.
spec.sessionAffinity: true
). Defaulting tofalse
.Set to true to configure Knative to route sequential requests for a given user to the same Revision container instance.
Knative would inspect the value of a cookie to identify multiple requests by the same user and then direct all such requests to the same instance.
Of course If the instance is rebooted, unhealthy, overloaded or becomes unavailable when the number of instances has been scaled down, session affinity will be broken and further requests are then routed to a different instance. It's "best effort" affinity, due to the autoscaling nature of Knative.
The text was updated successfully, but these errors were encountered: