Extending lifetime of affinity cookie per request

305 Views Asked by At

We´re using an haproxy ingress in our kuberntes cluster with cookie affinity for sticky session handling.

The ingress configuration like this:

ingress.kubernetes.io/affinity: cookie
ingress.kubernetes.io/session-cookie-keywords: indirect nocache httponly attr Max-Age=3600
ingress.kubernetes.io/session-cookie-name: IngressCookie

We expected the cookie´s lifetime to be extended after each request/response but this is not the case. We´re only receiving the cookie once (for the first request) for given Max-Age period.

Can this behavior be changed?

As a workaround we removed the Max-Age attribute - now the cookie lives as long as the client-session (e.g. browser instance is active). But this could lead to prevent redeploying/updating the pods in cluster as we´re also using drain-support feature (and active clients could reach the same pod again if the client-session is still active).

0

There are 0 best solutions below