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

session affinity: source ip #3703

Closed
snqk opened this issue May 22, 2021 · 10 comments · Fixed by #4141
Closed

session affinity: source ip #3703

snqk opened this issue May 22, 2021 · 10 comments · Fixed by #4141
Assignees
Labels
area/httpproxy Issues or PRs related to the HTTPProxy API. area/sticky-session Issues or PRs about Contour's support for sticky sessions. kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@snqk
Copy link

snqk commented May 22, 2021

Please describe the problem you have

Contour supports sticky sessions through session affinity, and more specifically through loadBalancerPolicy strategy: Cookie.

When implementing workloads where you'd need tls passthrough, it'd be useful to have the source (/ client) ip and route requests to the same upstream.

I am not sure if that is possible today in envoy though.

@snqk snqk added kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. labels May 22, 2021
@sunjayBhatia
Copy link
Member

Envoy supports load balancing on source IP: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-msg-config-route-v3-routeaction-hashpolicy-connectionproperties

We support request header hashing as a load balancing policy and could extend it to support connection propertly/source IP load balancing: https://projectcontour.io/docs/v1.15.1/config/request-routing/

@sunjayBhatia sunjayBhatia added the area/httpproxy Issues or PRs related to the HTTPProxy API. label May 24, 2021
@snqk
Copy link
Author

snqk commented May 24, 2021

@sunjayBhatia thanks for your response!

I'm afraid headers won't be readable through a tcp_proxy in the case of a TLS passthrough right?

@sunjayBhatia
Copy link
Member

Correct but the connection property hashing feature isn’t related to the http headers, to clarify they are separate hash policies we can make configurable

@youngnick
Copy link
Member

Thanks for raising this issue @sarthak40!

This is probably linked to similar issues:
#3099
#3044
#3142
that are also about new hash policy options. I'll make sure it's put in the "to be investigated" bucket there as well.

@xaleeks
Copy link

xaleeks commented Jun 3, 2021

Source IP seems highly useful for session affinity. And we should consider allow specifying the source IP in combination with headers for generating the hash value, leveraging the terminal:true to advance through the set of conditionals. All on a per route basis. Can we investigate this design for v1.17? I'm going to tag it for visibility. cc @skriss

Looking at the issue Nick linked here #3044, it seems we can leverage the parameters afforded by Envoy? ie. the TTL can be useful as well.

Do you have a preference for what the stanza should look like within httpproxy? @sarthak40

@xaleeks xaleeks added the area/sticky-session Issues or PRs about Contour's support for sticky sessions. label Jun 3, 2021
@xaleeks
Copy link

xaleeks commented Jul 1, 2021

@youngnick do we have bandwidth to tackle this in 1.18?

@youngnick youngnick added the blocked/needs-design Categorizes the issue or PR as blocked because it needs a design document. label Jul 20, 2021
@youngnick youngnick removed the lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. label Jul 20, 2021
@youngnick
Copy link
Member

So, we don't have bandwidth to work on this for a little while, moved to the Prioritized Backlog.

@xaleeks
Copy link

xaleeks commented Oct 24, 2021

Can we land this in v1.20?

@youngnick
Copy link
Member

It seems likely, given that we have a while before we will (most likely) release 1.20. @sunjayBhatia, any thoughts on how much effort this would be, since you've touched this code most recently?

@sunjayBhatia
Copy link
Member

should be much to do here, mainly just adding a new optional field to RequestHashPolicy and wiring that through, writing unit/feature tests since e2e tests are a little tricky here

@sunjayBhatia sunjayBhatia self-assigned this Oct 26, 2021
@sunjayBhatia sunjayBhatia removed the blocked/needs-design Categorizes the issue or PR as blocked because it needs a design document. label Oct 26, 2021
@sunjayBhatia sunjayBhatia added this to the 1.20.0 milestone Oct 26, 2021
@stevesloka stevesloka moved this to Todo in Contour Oct 26, 2021
sunjayBhatia added a commit to sunjayBhatia/contour that referenced this issue Oct 27, 2021
- must specify exactly one of header hashing policy or source ip hashing
in a list element (otherwise ignored and warning generated)
- cant specify to hash source ip multiple times (otherwise ignored and
warning generated)

Fixes: projectcontour#3703

Signed-off-by: Sunjay Bhatia <[email protected]>
@skriss skriss moved this from Todo to In Progress in Contour Oct 27, 2021
sunjayBhatia added a commit that referenced this issue Nov 1, 2021
- must specify exactly one of header hashing policy or source ip hashing
in a list element (otherwise ignored and warning generated)
- cant specify to hash source ip multiple times (otherwise ignored and
warning generated)

Fixes: #3703

Signed-off-by: Sunjay Bhatia <[email protected]>
Repository owner moved this from In Progress to Done in Contour Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/httpproxy Issues or PRs related to the HTTPProxy API. area/sticky-session Issues or PRs about Contour's support for sticky sessions. kind/feature Categorizes issue or PR as related to a new feature.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants