我们有一个包含 k8s + Rancher 2(3 个节点)和外部 nginx 的环境,根据本文档,该环境仅将连接转发到 k8s 集群:https ://rancher.com/docs/rancher/v2.x/en/installation/ k8s-安装/
在此环境中运行的特定应用程序中,当我们执行 POST(因为此 POST 大约需要 3 到 4 分钟才能完成)时,它会在 60 秒后被中断,并显示消息“504 Gateway Time-Out”。我尝试应用特定注释来更改超时,如下所示,但无济于事:
应用入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api-loteamento-spring-hml
annotations:
nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/server-snippet: "keepalive_timeout 3600s;client_body_timeout 3600s;client_header_timeout 3600s;"
labels:
run: api-loteamento-spring-hml
spec:
rules:
- host: hml-api-loteamento-sp.gruposfa.bla.bla
http:
paths:
- backend:
serviceName: api-loteamento-spring-hml
servicePort: 80
Run Code Online (Sandbox Code Playgroud)
我还尝试使用以下参数创建全局 ConfigMap,但也没有成功:
[rancher@srv-rcnode01 ssl]$ kubectl get pods -n ingress-nginx
NAME READY STATUS RESTARTS AGE
default-http-backend-67cf578fc4-lcz82 1/1 Running 1 38d …Run Code Online (Sandbox Code Playgroud)