HTTPS 负载平衡 Google 容器集群

HTTPS Load Balancing Google Container Cluster

我正在尝试对公开端口 7654 的集群进行负载平衡。我已遵循 instructions here。当完全按照它(创建 nginx 集群)时,它工作正常,但是当我尝试将它应用到我的容器时,我无法让它通过健康检查。如果我使用 kubectl 通过 LoadBalancer 而不是 NodePort 来公开 7654,我就能够连接,所以看起来容器工作正常。有人对创建负载均衡器有什么建议吗?

根据 https://cloud.google.com/compute/docs/load-balancing/health-checks#overview 健康检查成功 "must return a valid HTTP response with code 200 and close the connection normally within the timeoutSec period"。您的空响应可能没有关闭 HTTP 连接,添加 HTML 内容导致您的后端关闭连接。