-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nginx] sticky upstream not used #1093
Comments
Also as far as I can see the configmap config "enable-sticky-sessions" doesn't matter here at all. |
I can confirm that in beta.10 too which I was using ATM |
The referenced pull request is not fixing this issue since there is no rewrite in this use case. Or at least it even occurs without rewrites. I figured out how to make it work without a code change. Defining an explicit path makes the nginx.conf contain sticky upstreams in proxy_pass directives: - host: my-host.example.com
http:
paths:
- - backend:
+ - path: /
+ backend:
serviceName: my-backend-service
servicePort: http Here's the complete YAML: apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-sticky-ingress
labels:
app: my-sticky-app
annotations:
ingress.kubernetes.io/affinity: "cookie"
ingress.kubernetes.io/session-cookie-name: "route"
ingress.kubernetes.io/session-cookie-hash: "sha1"
spec:
rules:
- host: my-host.example.com
http:
paths:
- path: /
backend:
serviceName: my-backend-service
servicePort: http Generated upstreams:
Generated server block:
Unfortunately I'm not this good with Go. So maybe someone else could determine the real issue and fix it. |
I'm not sure and I don't want to downgrade nginx now but is it possible that I need to set the path explicitly since #871? Or should path be set anyway? |
@Gacko you should set a path |
So the path is required even without sticky sessions? Okay. Then I guess this issue can stay closed. I was wondering since all my non-sticky ingresses were working even without the path. |
Here https://kubernetes.io/docs/concepts/services-networking/ingress/#name-based-virtual-hosting it's documented without a path. |
@aledbf Can I assume this means the documentation is incorrect? If yes, I would open up an issue for the docs. |
... or could it be defaulted to Being able to omit it would be far better for those only interested in name based virtual hosting. They probably do not define |
thanks for that @Gacko . i didnt explicitly set a path and got the same issue as you. after setting path was fine. |
With beta.11 it seems the sticky upstream is created next to the default one, but it is actually never used within the server block.
excerpt from nginx.conf:
The text was updated successfully, but these errors were encountered: