GKE 入口超时值

GKE Ingress Timeout Values

我想在我的网络应用程序中使用网络套接字。现在我的 websocket 每 30 秒断开连接并重新连接一次,这是 GKE Ingress 中的默认超时。我尝试了以下方法来更改超时值:

metadata:
  name: my-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.org/proxy-connect-timeout: "300"
    nginx.org/proxy-read-timeout: "3600"
    nginx.org/proxy-send-timeout: "3600"

通过 kubectl 重新创建入口后,超时值保持 30 秒:

我还尝试按照此处所述创建后端配置:https://cloud.google.com/kubernetes-engine/docs/how-to/configure-backend-service

超时值仍然保持在30秒不变。

有没有办法通过.yml 文件中的注释来增加超时值?我可以通过 Web 界面编辑超时值,但我更愿意使用 .yml 文件。

已修复。我将我的主节点及其节点升级到 1.14 版,然后后端配置方法起作用了。

这似乎不是版本问题。

只要GKE版本是1.11.3-gke.18及以上here, you should be able to update the timeoutSec value by configuring the 'BackendConfig' as explained in the help center article

我通过编辑示例 manifest 更改了 timeoutSec 值,然后使用“kubectl apply -f my-bsc-backendconfig.yaml 更新 BackendConfig(在我的 GKE 1.13.11-gke.14 集群中) " 命令。