所以这是我的问题,我想在Kubernetes ingress资源3超时参数中设置。 Kubernetes文档中描述的方法是使用入口资源注释或ConfigMap。在下面的示例中,我尝试使用注释,但由于未知原因,更改未生效。
nginx.org/proxy-connect-timeout: 10s
nginx.org/proxy-read-timeout: 10s
nginx.org/proxy-send-timeout: 10s
我在我的入口资源定义中设置了这些参数:
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: /
设置nginx配置的另一种方法是通过ConfigMap,但我不想全局这样做,所以我需要使用注释来实现。
答案 0 :(得分:5)
您确定这些是正确的注释吗?看看ingress/annotations/proxy/main.go,其中定义了以下常量:
connect = "ingress.kubernetes.io/proxy-connect-timeout"
send = "ingress.kubernetes.io/proxy-send-timeout"
read = "ingress.kubernetes.io/proxy-read-timeout"