【问题标题】:Kubernetes on GCE: Ingress Timeout ConfigurationGCE 上的 Kubernetes:入口超时配置
【发布时间】:2017-11-19 22:28:02
【问题描述】:

我在 Google Compute Engine (GCE) 上运行 Kubernetes。我有一个 Ingress 设置。一切正常,除了当我上传大文件时,L7 HTTPS 负载均衡器会在 30 秒后终止连接。我知道我可以在“后端服务”中手动提升它,但我想知道是否有办法从 Ingress 规范中做到这一点。我担心我的手动调整会在以后改回 30 秒。

nginx 入口控制器有许多可用于配置 nginx 的注解。 GCE L7 负载均衡器有类似的东西吗?

【问题讨论】:

  • 是的,它有类似的注释。更快找到这些可能是通过谷歌云控制台配置它
  • 我担心如果我手动更改某些内容,下次更改入口规范时更改会被覆盖。

标签: nginx kubernetes google-cloud-platform google-compute-engine load-balancing


【解决方案1】:

现在可以使用自定义资源 BackendConfig 在 GKE 中进行配置。

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

【讨论】:

    【解决方案2】:

    对于寻求解决此问题的其他人,timeout 和其他设置(例如启用 CDN)目前只能手动配置。

    Follow this kubernetes/ingress-gce issue 获取有关长期解决方案的最新更新。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      • 2019-03-24
      • 2016-10-28
      • 2016-04-05
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      相关资源
      最近更新 更多