ingress-nginx: consistent hashing does not work with dynamic configuration
Is this a BUG REPORT or FEATURE REQUEST? BUG REPORT
NGINX Ingress controller version: 0.20.0
Kubernetes version (use kubectl version): 1.10.5
Environment: ubuntu
- Cloud provider or hardware configuration: aws
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a): - Install tools: puppet
- Others:
What happened: We used consistent hashing as described in: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-nginx-upstream-hashing w. version 0.16.2 of the nginx-ingress, and it worked nicely
then we upgraded to 0.20.0 and suddenly only one pod got traffic. We’ve rolled back to 0.16.2 and verified that it worked again.
We seem to have isolated it to the dynamic configuration feature, since if we disable it using the --enable-dynamic-configuration=false, then it works on 0.20.0.
this is our annotation:
nginx.ingress.kubernetes.io/upstream-hash-by: $request_uri$http_x_user_id
We suspected it was due to the double variable, so we tried with just nginx.ingress.kubernetes.io/upstream-hash-by: $request_uri but it still didn’t work.
What you expected to happen:
I expect the traffic to be consistently routed based on the upstream-hash-by
How to reproduce it (as minimally and precisely as possible):
Upgrade to 0.20.0, add nginx.ingress.kubernetes.io/upstream-hash-by: $request_uri$http_x_user_id to the ingress.
Repeatedly call the service w. different request_uri’s or x-user-id headers and observe only one pod gets traffic.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (10 by maintainers)
Upgrading to 0.21.0 seems to have fixed it! Thanks for the help.
We’re looking forward to #3460 so we can use the double variable setup.