gloo icon indicating copy to clipboard operation
gloo copied to clipboard

Add support for the envoy `StatefulSession` filter

Open kevin-shelaga opened this issue 1 year ago • 0 comments

Gloo Edge Product

Enterprise

Gloo Edge Version

1.15.x

Is your feature request related to a problem? Please describe.

Scaling pods either up or down affects all pods current session affinity with either maglev or ring hash.

Describe the solution you'd like

https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/stateful_session_filter

Describe alternatives you've considered

None. But here is a envoy filter IF using istio unrelated to edge.

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: stateful
  namespace: istio-system
spec:
  workloadSelector:
    labels:
      istio: ingressgateway
  configPatches:
  - applyTo: HTTP_FILTER
    match:
      context: GATEWAY
      listener:
        filterChain:
          filter:
            name: "envoy.filters.network.http_connection_manager"
            subFilter:
              name: "envoy.filters.http.router"
    patch:
      operation: INSERT_BEFORE
      value:
        name: envoy.filters.http.stateful_session
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.http.stateful_session.v3.StatefulSession
          session_state:
            name: envoy.http.stateful_session.cookie
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.http.stateful_session.cookie.v3.CookieBasedSessionState
              cookie:
                # Name of the cookie
                name: global-session-cookie
                # Path to set. Exercise caution here, as https://github.com/envoyproxy/envoy/issues/19655 may break persistence
                path: /
                # TTL of cookie. Can be set to 0 for session based
                ttl: 120s

Additional Context

No response

kevin-shelaga avatar Jan 26 '24 12:01 kevin-shelaga