application-gateway-kubernetes-ingress icon indicating copy to clipboard operation
application-gateway-kubernetes-ingress copied to clipboard

Cookie based affinity timeout

Open dcasavant opened this issue 5 years ago • 2 comments

Is your feature request related to a problem? Please describe. When using cookie based session affinity (appgw.ingress.kubernetes.io/cookie-based-affinity: "true"), I want to specify a cookie timeout.

In this use case, session affinity is used to take advantage of locally cached data in a container for performance benefits. We also use an HPA for Pod autoscaling. After a scale up event we still want to rebalance users across containers. The balance between the efficiency gain of local caches and the additional resources available can be tuned by specifying a cookie timeout. That is, once a user is idle for long enough, we want to rebalance them evenly across the available containers.

Describe the solution you'd like I want to specify a cookie timeout using an annotation on the ingress:

apiVersion: extensions/v1beta1
metadata:
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
    appgw.ingress.kubernetes.io/cookie-based-affinity-timeout: 600

A similar solution for AWS' ALB works as follows:

alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=600

dcasavant avatar Feb 14 '20 16:02 dcasavant

@dcasavant This is a feature ask on Application Gateway as it doesn't support cookie timeout.

akshaysngupta avatar Feb 19 '20 00:02 akshaysngupta

I have raised this as an idea on the Azure feedback portal. Please vote for it if you would like this implemented: Application Gateway Cookie-based Affinity stickiness timeout

adamgsmithmatillion avatar Jun 21 '22 16:06 adamgsmithmatillion