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

Add support for session affinity during weighted routing with Istio #1280

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

aryan9600
Copy link
Member

Add support for session affinity/sticky sessions during weighted routing with Istio, i.e. when a user is routed to the canary deployment, all subsequent requests from that user will hit the canary deployments, even though weighted routing is active.

This feature can be enabled by specifying a .spec.analysis.sessionAffinty.cookieName. This value combined with a random sequence (<cookie-name>: <random-sequence>) is used as the value of the Set-Cookie header, and then all requests' headers that match against this value are sent to the canary deployment. Users can also specify .spec.analysis.sessionAffinity.maxAge to configure the lifetime of the cookie being set.

Fixes: #1198, #1232

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2022

Codecov Report

Base: 54.45% // Head: 54.72% // Increases project coverage by +0.27% 🎉

Coverage data is based on head (b095713) compared to base (882286d).
Patch coverage: 82.17% of modified lines in pull request are covered.

❗ Current head b095713 differs from pull request most recent head d16c969. Consider uploading reports for the commit d16c969 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1280      +/-   ##
==========================================
+ Coverage   54.45%   54.72%   +0.27%     
==========================================
  Files          81       81              
  Lines        9408     9515     +107     
==========================================
+ Hits         5123     5207      +84     
- Misses       3663     3682      +19     
- Partials      622      626       +4     
Impacted Files Coverage Δ
pkg/router/istio.go 76.89% <82.17%> (+0.45%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

Please document this feature in deployment-strategies.md and in the Istio guides.

Add `.spec.analysis.sessionAffinity` to configure session affinity for
weighted routing. Add support for session affinity in the Istio router,
using the `Set-Cookie` and `Cookie` headers.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
@aryan9600 aryan9600 marked this pull request as ready for review November 10, 2022 07:47
@aryan9600 aryan9600 force-pushed the sticky-istio branch 2 times, most recently from 21afb7c to 3f9960e Compare November 10, 2022 09:44
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @aryan9600 🏅

@stefanprodan stefanprodan added the kind/enhancement Improvement request for an existing feature label Nov 15, 2022
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvement request for an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for session affinity based on both headers/cookies and weights How do I setup session affinity?
3 participants