How to fix “failed to ensure load balancer” error for nginx ingress

匆匆过客 提交于 2020-02-06 23:52:47

问题


When setting a new nginx-ingress using helm and a static ip on Azure the nginx controller never gets the static IP assigned. It always says <pending>.

I install the helm chart as follows -

helm install stable/nginx-ingress --name <my-name> --namespace <my-namespace> --set controller.replicaCount=2 --set controller.service.loadBalancerIP="<static-ip-address>"

It says it installs correctly but there is an error listed as well

E0411 06:44:17.063913 13264 portforward.go:303] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:57881->127.0.0.1:57886: write tcp4 127.0.0.1:57881->127.0.0.1:57886: wsasend: An established connection was aborted by the software in your host machine.

I then do a kubectl get all -n <my-namespace> and everything is listed correctly just with the external IP as <pending> for the controller.

I then do a kubectl describe -n <my-namespace> service/<my-name>-nginx-ingress-controller and this error is listed under Events -

Warning CreatingLoadBalancerFailed 11s (x4 over 47s) service-controller Error creating load balancer (will retry): failed to ensure load balancer for service my-namespace/my-name-nginx-ingress-controller: timed out waiting for the condition.

Thank you kindly


回答1:


For your issue, the possible reason is that your public IP is not in the same resource group and region with the AKS cluster. See the steps in Create an ingress controller with a static public IP address in Azure Kubernetes Service (AKS).

You can get the AKS group through the CLI command like this:

az aks show --resource-group myResourceGroup --name myAKSCluster --query nodeResourceGroup -o tsv

When your public IP in a different group and region, then it will give the time out error as you.



来源:https://stackoverflow.com/questions/55625051/how-to-fix-failed-to-ensure-load-balancer-error-for-nginx-ingress

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!