How to configure nginx ingress resource timeout parameters

8/11/2017

So here is my problem, I want to set up in Kubernetes ingress resource 3 timeout parameters. Described method in the Kubernetes docs is to use either ingress resource annotations or ConfigMap. In the example below I am trying with annotations but for unknown reason the change is not taking effect.

nginx.org/proxy-connect-timeout: 10s
nginx.org/proxy-read-timeout: 10s
nginx.org/proxy-send-timeout: 10s

I am setting those parameters in my ingress resource deffinition:

kind: Ingress
metadata:
  name: my-foobar-ingress
  namespace: foobar
  annotations:
    nginx.org/proxy-send-timeout: "10s"
    nginx.org/proxy-connect-timeout: "10s"
    nginx.org/proxy-read-timeout: "10s"

spec:
  rules:
  - host: foobar.foo.bar
    http:
      paths:
      - backend:
          serviceName: foobar-svc
          servicePort: 8080
        path: /

The other way to set up nginx configurations is through a ConfigMap, but I do not want to do it globally so I need to use annotations to do so.

-- Veselin Hristov
kubernetes
nginx

1 Answer

8/11/2017

Are you sure these are the correct annotations? Have a look at ingress/annotations/proxy/main.go, where the following constants are defined:

connect      = "ingress.kubernetes.io/proxy-connect-timeout"
send         = "ingress.kubernetes.io/proxy-send-timeout"
read         = "ingress.kubernetes.io/proxy-read-timeout"
-- user3151902
Source: StackOverflow