ingress-nginx: proxy timeout annotations have no effect on nginx
NGINX Ingress controller version: 0.10.2 / quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.2
Kubernetes version (use kubectl version
):
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.1", GitCommit:"3a1c9449a956b6026f075fa3134ff92f7d55f812", GitTreeState:"clean", BuildDate:"2018-01-04T11:52:23Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Environment:
- Cloud provider or hardware configuration: Bare metal / On premise
- OS (e.g. from /etc/os-release): Debian GNU/Linux 9 (stretch)
- Kernel (e.g.
uname -a
): 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux - Install tools: kubeadm
- Others: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.2
What happened:
NGINX Ingress Controller v0.10.2 configuration doesn’t reflect the proxy timeout annotations per Ingress.
This Ingress definition doesn’t work as expected :
---
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: ing-manh-telnet-client
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy‑connect‑timeout: 30
nginx.ingress.kubernetes.io/proxy‑read‑timeout: 1800
nginx.ingress.kubernetes.io/proxy‑send‑timeout: 1800
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
tls:
- hosts:
- "manh-telnet.ls.domain.io"
secretName: "tls-certs-domainio"
rules:
- host: "manh-telnet.ls.domain.io"
http:
paths:
- path: "/"
backend:
serviceName: svc-manh-telnet-client
servicePort: http
The actual vhost :
# Custom headers to proxied server
proxy_connect_timeout 30s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
What you expected to happen:
The wanted vhost :
# Custom headers to proxied server
proxy_connect_timeout 30s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 44 (8 by maintainers)
I had the same problem and discovered that the following do not work:
nginx.ingress.kubernetes.io/proxy‑read‑timeout: 1800 nginx.ingress.kubernetes.io/proxy‑read‑timeout: 1800s nginx.ingress.kubernetes.io/proxy‑read‑timeout: “1800s”
What does work is:
nginx.ingress.kubernetes.io/proxy‑read‑timeout: “1800”
Adding client_body_timeout was the key fix for me here. This needs to be put in the documentation somewhere since it was hard to find
After way to much trial and error and frustration; some tips that might work for others who end up here:
nginx.ingress.kubernetes.io/proxy-connect-timeout
did not work for me. Nothing changed in the nginx configuration in the ingress controller. No errors were shown. Removing the initialnginx.
did work. Ending up with these annotations:You have an incorrect char “-” in your annotations. In my configuration nginx.ingress.kubernetes.io/proxy-read-timeout is written and it works on the same version (0.10.2).
what is the approved solution for this… for me also its same… its getting CLIENT_DISCONNECTED exactly in 60sec, I have tried all options mentioned in this forum but not working… any solid clue to get it fixed?
From the first tip in the docs https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/
@Tim-Schwalbe I am using the helm chart as well, although a different version. It only worked with ConfigMaps.
Here are the steps that helped me. You need the name of the pod running the controller. Say
nginx-ingress-controller-1234abcd
Make sure you’re running images from quay.io
$ kubectl describe pod nginx-ingress-controller-1234abcd | grep Image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.15.0
if it doesn’t start withquay.io
the following steps may not be relevant.Determine the name of the ConfigMap it reads all those properties from:
$ kubectl describe pod nginx-ingress-controller-1234abcd | grep configmap=
--configmap=default/nginx-ingress-controller
That means it reads from from a ConfigMap with name
nginx-ingress-controller
in thedefault
namespace. Append such a ConfigMap to you Ingress yaml file:Properties you can add to the ConfigMap compiled in the table here: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/configmap.md
The result in /etc/nginx/nginx.conf
proxy_read_timeout 234s;
I hope that was helpful.
Bumping this: we hit a worse version of this problem when moving from 1.12.1 to 1.12.4. Apparently now if you have these invalid values (not specified as strings) all of your annotations are discarded. Seems like ‘kubectl apply’ with invalid annotations shouldn’t silently accept and discard these values.
To turn this around: is anyone actually able to have something communicate across a kubernetes cluster boundary with >60s idle time between packets? Perhaps using something else than nginx?
I had to use the string version instead of the number version, any idea why this is?
This breaks:
This works:
For me this is not working. Anyone sees an issue? I am using the nginx helm chart: nginx-ingress-0.8.9
Closing. As @akaGelo commented you have an issue with the
-
. Is my fault. I am sure you copy/paste from the docs (a good thing) but in order to make readable the table the character was different Please check https://github.com/kubernetes/ingress-nginx/pull/2111I’m really surprised to see that everyone is proposing solutions but their is not single final solution proposed and used by everyone. Why is it such a mess with ngnix? 504 error is just bugging us alot as well
The hyphens are not the normal hyphens - but just look like them.
What @akaGelo is trying to say is that if you use your browsers search option and put in a
-
then some of them will not be highlighted. These are those hyphens which are not the correct ones.@yivo you’re missing the beginning of the annotation, you need
nginx
in front ofingress
,so instead of
you should have
Doesn’t work for me.
Okay so this:
works but only after restarting the complete nginx controller deployment! It is somehow not picking up on ingress change! Seems like a bug to me.
I used k9s to shell into the pod and executed:
@jontro This definitely must be included at the front page of the documentation. This helped me(+ saved me) a lot. Thanks.
I seem you are using the GCE ingress controller. This annotation only works in nginx
I ran into this as well. I’m assuming an integer is required for timeouts? I was using “5m” because Nginx docs seemed to show that I could. Changed to 300 and things worked great after that.
Oh now that’s seems very obvious ! Thanks guys, that was a pretty simple mistake. I’ll look into official documentation if we can improve that with the same type of character for working copy/paste.
@garagatyi Maybe you have the same problem ? You should also update your ingress revision.
I don’t get the point, annotations were tested one by one and
-
is an acceptable YAML value. Can you elaborate a bit more aboutan incorrect - in my annotations
?