I have an AKS cluster with a web application. I want to provision an nginx Ingress controller to expose the app to the internet and later enable TLS.
I have been following the official documentation
https://learn.microsoft.com/en-us/azure/aks/ingress-basic
and
https://learn.microsoft.com/en-us/azure/aks/ingress-static-ip
But I always end up with a pending nginx-ingress service with this error
reason: SyncLoadBalancerFailed
message: >-
Error syncing load balancer: failed to ensure load balancer: instance not
found
I have seen
How to fix "failed to ensure load balancer" error for nginx ingress
and googled the error but so far no luck
Does anyone know what could it be?
Or, is there some working example I can start from?
2
Answers
I believe you are using a static IP address with the NGINX Ingress controller service. This issue pops up if the cloud controller manager cannot find the static Azure Public Ip Address resource in the containing resource group mentioned in the NGINX Ingress Controller’s service annotation (if no resource group is explicitly specified with a service annotation, it will look for the Azure Public IP Address resource in the AKS cluster’s node resource group)
If you have created the static Azure Public IP Address resource in the node resource group then please ensure that the Azure Public IP address resource exists.
If you have created the static Azure Public IP Address resource in a different resource group, then:
Please ensure the cluster identity used by the AKS cluster has delegated permissions to the other resource group, such as Network Contributor.
Note: Your cluster identity can be a service principal or a managed identity.
In the
helm install
command to deploy an NGINX Ingress Controller, please add the following argument:--set controller.service.annotations."service.beta.kubernetes.io/azure-load-balancer-resource-group"=$PublicIpAddressResourceGroupName
Thus, if you are following this document the helm install command should look something like:
For more information please check here.
I got the same error with a non nginx-ingress load balancer in AKS and fixed the issue by stopping and re-starting the cluster through the Azure portal.
Spent a lot of time looking for solutions online and didn’t find anything that worked.