-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
What happened:
When more than one ingress is defined for a single host, and at least two use the nginx.ingress.kubernetes.io/affinity: cookie annotation, if each of them uses a different nginx.ingress.kubernetes.io/session-cookie-path annotation, then those ingress' paths are load balanced randomly between the backend servers (ignoring the cookie affinity).
What you expected to happen:
I expected the load balancing would follow the cookie affinity.
The load balancing did not follow the cookie affinity, instead it was distributed randomly between the backend servers. I suspect the lua code doing the cookie affinity distribution does not account for this situation.
NGINX Ingress controller version (exec into the pod and run /nginx-ingress-controller --version): v1.12.7
Kubernetes version (use kubectl version): v1.31.13-eks-113cf36
How to reproduce this issue:
- Create 2 ingresses for the same host
- Backend for each ingress should be the same, but pointing to at least 2 different servers
- Set the
nginx.ingress.kubernetes.io/affinity: cookieannotation on both - Set the
nginx.ingress.kubernetes.io/session-cookie-pathannotation on each, but different (in my case/pathon one and/path/sub-pathon other)
- Visit one of the load balanced paths repeatedly, find that the load balancing is distributing randomly between the backend servers
Metadata
Metadata
Assignees
Labels
Type
Projects
Status