我在 GKE 上部署了集群,并通过Ingress公开。静态资源和多数或 REST 请求工作正常。但我在下载文件请求时收到 502 服务器错误。错误信息是:The server encountered a temporary error and could not complete your request.Please try again in 30 seconds.
如果没有 Ingres,当使用 LoadBalancer 时,下载工作正常。我怀疑 Ingress 不喜欢后端响应。这是成功响应标头(没有 Ingress):
HTTP/1.1 200 OK
transfer-encoding: chunked
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with, authorization, Content-Type, Authorization, credential, X-XSRF-TOKEN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2018 13:55:39 GMT
我试过的:
- 将云控制台中入口转发规则的后端服务超时从默认的 30 秒增加到 100 秒
- 搜索堆栈驱动程序日志 - 没有找到入口控制器的任何日志。
为什么此请求不适用于 Ingress,如何解决?我在哪里可以找到 GKE 中的 Ingress 日志?