Skip to content

SessionPersistence based on URL #4385

@pierreozoux

Description

@pierreozoux

What would you like to be added:

In GEP 1619 - Session Persistence via BackendLBPolicy, 3 ways to achieve session persistence are discussed:

  • cookie
  • header
  • url encoded

But in the GEP, only cookie and header are in the spec.

I'd like to also have url encoded session persistence in the spec.

Why this is needed:

Use case / Problem space:

My use case is that I'm coming from ingress-nginx, and I use this annotation upstream-hash-by in different places:

nginx.ingress.kubernetes.io/upstream-hash-by: $arg_room
nginx.ingress.kubernetes.io/upstream-hash-by: $request_uri
nginx.ingress.kubernetes.io/upstream-hash-by: $arg_WOPISrc

Usually, it is a collaboration server where the collaboration on a document happens in one pod, and you want to direct traffic there based on the docId so that users can collaborate on this document on this server. (Or could be a visio room, you get the idea.)

Alternative solutions considered:

  • nginx in front of the servers, but somehow this would be a kind of small nginx-ingress just for that logic
  • have an Application LoadBalancer that would be aware of "documents" and "servers" and keep the mapping somehow, and set a cookie in the response so that next request can be directed with session persistence

(So it would be easier if that would be implemented in the kubernetes gateway api spec!)

Already existing implementations:

I didn't find any in cilium nor kgateway (nor open issues to direct to).

Historic Istio seems to have something:
https://istio.io/latest/docs/reference/config/networking/destination-rule/#LoadBalancerSettings-ConsistentHashLB

Envoy Gateway just merged one implementation:
https://github.com/envoyproxy/gateway/pull/7428/files

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions