【发布时间】:2019-01-23 08:55:47
【问题描述】:
我在 GKE 上安装 Istio 并运行应用程序。
虽然使用curl访问没有问题,但是Ingressgateway在浏览器访问时通过一些图片请求返回的状态码与Pod的代理的状态码不同。具体而言,200 和 302 等作为 500 或 504 返回。成为 500 或 504 的资源每次都不同,但它是大约 100 个图像请求中的 1 个或 2 个。如果您再次请求另一个 500 或 504 请求,正确的响应将毫无问题地返回。
你知道是什么原因造成的吗?
环境是这样的。
GKE 1.10.11-gke.1
Istio 1.0.4
helm install install/kubernetes/helm/istio --name istio --namespace istio-system --set tracing.enabled=true --set kiali.enabled=true --set global.proxy.includeIPRanges="10.0.0.0/8"
以下是从 Stackdriver Logging 获取的日志。
Ingressgateway 日志。
"[2019-01-22T09:16:17.048Z] \"GET /my/app/image.pngHTTP/2\" 504 UT 0 24 60001 - \"xxx.xxx.xxx.xxx\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36\" \"c0abe3be-1153-45c5-bd8e-067ab597feb4\" \"my.app.com\" \"10.128.0.116:80\" outbound|80|ga|myapp.default.svc.cluster.local - 10.128.0.16:443 xxx.xxx.xxx.xxx:62257\n"
Application Pod 的 istio-proxy 日志。
"[2019-01-22T09:16:17.048Z] \"GET /my/spp/images.pngHTTP/1.1\" 200 - 0 3113 0 0 \"xxx.xxx.xxx.xxx\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36\" \"c0abe3be-1153-45c5-bd8e-067ab597feb4\" \"my.app.com\" \"127.0.0.1:80\" inbound|80||myapp.default.svc.cluster.local - 10.128.0.116:80 xxx.xxx.xxx.xxx:0\n"
nginx 日志。
{
"uri": "/my/app/image.png",
"host": "my.app.com",
"requestTime": "0.000",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
"xForwardedProto": "https",
"user": "",
"protocol": "HTTP/1.1",
"bodyByteSize": "3113",
"method": "GET",
"remoteAddress": "127.0.0.1",
"upstreamResponseTime": "",
"request": "GET /my/app/images.png HTTP/1.1",
"referrer": "https://my.app.com/",
"status": "200",
"xForwardedFor": "xxx.xxx.xxx.xxx"
}
查看此日志,我认为 Ingressgateway 正在丢弃来自 Pod 的响应。
【问题讨论】:
标签: kubernetes google-kubernetes-engine istio