我在 Google Compute Engine (GCE) 上运行 Kubernetes。我有一个 Ingress 设置。一切正常,除了当我上传大文件时,L7 HTTPS 负载均衡器会在 30 秒后终止连接。我知道我可以在“后端服务”中手动提高它,但我想知道是否有办法从 Ingress 规范中做到这一点。我担心我的手动调整稍后会改回 30 秒。
nginx 入口 Controller 有许多可用于配置 nginx 的注解。 GCE L7 负载均衡器是否有类似的东西?
最佳答案
现在可以使用自定义资源在 GKE 中进行配置 BackendConfig
.
apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: my-bconfig
spec:
timeoutSec: 60
然后配置您的
Service
将此配置与注释一起使用:apiVersion: v1
kind: Service
metadata:
name: my-service
annotations:
beta.cloud.google.com/backend-config: '{"ports": {"80":"my-bconfig"}}'
spec:
ports:
- port: 80
.... other fields
见 Configuring a backend service through Ingress
关于nginx - GCE 上的 Kubernetes : Ingress Timeout Configuration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44601191/