EKS 中的 Nginx 入口控制器无法将流量路由到 pods
Nginx ingress controller in EKS not able to route traffic to pods
我有一个 EKS 集群 运行 kubernetes 1.14。我按照以下 link.
中的这些步骤在集群上部署了 Nginx 控制器
这是我遵循的步骤 -
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f
https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/aws/service-l4.yaml
kubectl apply -f
https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/aws/patch-configmap-l4.yaml
但我一直在入口控制器中间歇性地收到这些错误。
2019/10/15 15:21:25 [error] 40#40: *243746 upstream timed out (110: Connection timed out) while connecting to upstream, client: 63.xxx.xx.xx, server: x.y.com, request: "HEAD / HTTP/1.1", upstream: "http://172.20.166.58:80/", host: "x.y.com"
有时这些 -
{"log":"2019/10/15 02:58:40 [error] 119#119: *2985 connect() failed (113: No route to host) while connecting to upstream, client: xx.1xx.81.1xx, server: a.b.com , request: \"OPTIONS /api/v1/xxxx/xxxx/xxx HTTP/2.0\", upstream: \"http://172.20.195.137:9050/api/xxx/xxx/xxxx/xxx\ ", host: \"a.b.com \", referrer: \"https://x.y.com/app/connections\"\n","stream":"stderr","time":"2019-10-15T02:58:40.565930449Z "}
我正在使用 Kubernetes 的原生 Amazon VPC CNI 插件进行联网 -
amazon-k8s-cni:v1.5.4
我注意到 nginx 入口控制器 pod 的 5 个副本中有几个副本无法与后端应用程序通信。
为了检查 nginx ingress controller pods 和后端应用程序之间的连接,我进入了 nginx ingress controller pod 并尝试 curl 后端服务并且它超时,但是当我 ssh 进入另一个后端服务然后 curl相同的后端服务 returns 200 状态代码。我暂时修复它的方法是删除无法与后端通信的副本并重新创建它。这暂时解决了问题,但几个小时后,同样的错误又开始出现。
amazon-k8s-cni:v1.5.4
DNS 和 pod 到 pod 通信存在已知问题。建议恢复到
amazon-k8s-cni:v1.5.3
我遇到了与您看到的相同的问题,回到 v1.5.3 似乎可以为我解决问题。我认为他们最近将插件恢复到 v1.5.3,以便无论如何启动 eks 集群。
我有一个 EKS 集群 运行 kubernetes 1.14。我按照以下 link.
中的这些步骤在集群上部署了 Nginx 控制器这是我遵循的步骤 -
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/aws/service-l4.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/aws/patch-configmap-l4.yaml
但我一直在入口控制器中间歇性地收到这些错误。
2019/10/15 15:21:25 [error] 40#40: *243746 upstream timed out (110: Connection timed out) while connecting to upstream, client: 63.xxx.xx.xx, server: x.y.com, request: "HEAD / HTTP/1.1", upstream: "http://172.20.166.58:80/", host: "x.y.com"
有时这些 -
{"log":"2019/10/15 02:58:40 [error] 119#119: *2985 connect() failed (113: No route to host) while connecting to upstream, client: xx.1xx.81.1xx, server: a.b.com , request: \"OPTIONS /api/v1/xxxx/xxxx/xxx HTTP/2.0\", upstream: \"http://172.20.195.137:9050/api/xxx/xxx/xxxx/xxx\ ", host: \"a.b.com \", referrer: \"https://x.y.com/app/connections\"\n","stream":"stderr","time":"2019-10-15T02:58:40.565930449Z "}
我正在使用 Kubernetes 的原生 Amazon VPC CNI 插件进行联网 -
amazon-k8s-cni:v1.5.4
我注意到 nginx 入口控制器 pod 的 5 个副本中有几个副本无法与后端应用程序通信。 为了检查 nginx ingress controller pods 和后端应用程序之间的连接,我进入了 nginx ingress controller pod 并尝试 curl 后端服务并且它超时,但是当我 ssh 进入另一个后端服务然后 curl相同的后端服务 returns 200 状态代码。我暂时修复它的方法是删除无法与后端通信的副本并重新创建它。这暂时解决了问题,但几个小时后,同样的错误又开始出现。
amazon-k8s-cni:v1.5.4
DNS 和 pod 到 pod 通信存在已知问题。建议恢复到
amazon-k8s-cni:v1.5.3
我遇到了与您看到的相同的问题,回到 v1.5.3 似乎可以为我解决问题。我认为他们最近将插件恢复到 v1.5.3,以便无论如何启动 eks 集群。