-
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
upstream hash by host
#3722
Comments
You seem to be describing several problems. Could you tell me more about |
Hi @JordanP The primary problem that I want to solves is: stick requests from the same http-host to the same backend.
In In |
Hi @LoicMahieu, could you share all the annotations (or the whole ingress object) you are using in the ingress? I've modified some code that's related to upstream-hash-by annotation, maybe I broke some specific use case. If you don't need the "subset" feature, you don't need to add those annotations. It's disabled by default. |
Hi @diegows Annotations are quite simple: apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
nginx.ingress.kubernetes.io/upstream-hash-by: $host
name: app-somedomain
spec:
rules:
- host: somedomain.com
http:
paths:
- backend:
serviceName: backend
servicePort: 80
path: / |
You must use quotes in all the annotations or K8s API is going to drop it somewhere before reaching the Nginx controller. |
Value is quoted in our sources. I used |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I am not completely confident that it is a bug report, do not hesitate to contradict me ;)
I have several ingresses and for some of them, I need to stick to one backend.
The reason is that theses apps are pretty old JSP apps that consumes a lot of memory. By arranging to gather requests from the same HTTP host on the same backend, it saves me some memory.
At the time of the
0.20.0
, I put this annotation:It seems to worked well. But I recently upgraded to
0.22.0
from0.20.0
and now the requests are balanced to each backends.upstream-hash-by = "$host"
? Is there a good way ? Will the controller switch to another backend if the previous is not healthy ?In the
0.20.0
, I observed some errors(113: No route to host) while connecting to upstream
due to backend scale up/down.upstream-hash-by-subset
andupstream-hash-by-subset-size
?It tried it but not works.
Thanks for your help. 👍
NGINX Ingress controller version:
0.22.0
Kubernetes version:
v1.11.6-gke.3
Cloud provider or hardware configuration: GKE
Install tools: Helm
The text was updated successfully, but these errors were encountered: