Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "failed to ensure load balancer" error for nginx ingress

Tags:

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

like image 619
Koman Avatar asked Apr 11 '19 05:04

Koman


People also ask

Does nginx ingress create a load balancer?

The Ingress Controller is an application that runs in a cluster and configures an HTTP load balancer according to Ingress resources. The load balancer can be a software load balancer running in the cluster or a hardware or cloud load balancer running externally.

Does ingress require load balancer?

The GKE Ingress controller creates and configures an HTTP(S) Load Balancer according to the information in the Ingress, routing all external HTTP traffic (on port 80) to the web NodePort Service you exposed. Note: To use Ingress, you must have the HTTP(S) Load Balancing add-on enabled.


1 Answers

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.

like image 124
Charles Xu Avatar answered Oct 12 '22 00:10

Charles Xu