Installing NGINX Ingress with Helm on AKS
This is a guide on installing a NGINX Ingress controller on Azure Kubernetes Service.
Prerequisites¶
A prerequisite for installing NGINX Ingress with Helm is of course Helm. Go to the Helm install docs and get a piece of that cake.
Efter installing Helm, add the ingress-nginx repo and update your Helm repositories.
Installing NGINX Ingress¶
Create a namespace in your cluster.
Run below command to install. This will create a load balancer resource with a public IP, in the AKS shadow resource group.
helm install ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set controller.service.type=LoadBalancer \
--set controller.service.externalTrafficPolicy=Local
...
--set controller.service.loadBalancerIP=<ip-address> \
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-resource-group"=<resource-group-name>
You also have the option to only make the load balancer available in your internal Vnet, by creating an internal load balancer. The load balancer will get an IP address from the Vnet.
...
--set-string controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-internal"="true"
Verify¶
After deploying the ingress controller, you can verify that the load balancer is ensured. It might take some time depending on your provider.
$ kubectl describe service ingress-nginx-controller --namespace ingress-nginx
...
Normal EnsuredLoadBalancer 2m32s service-controller Ensured load balancer
References¶
- NGINX-Ingress install documentation.
- NGINX configuration with Helm parameters.
- AKS Ingress basic documentation.
- AKS load balancer configuration with annotations.