In my previous post, I showed how to install
helm CLI on a server/instance running AlmaLinux 9. Now, I will share how to use
helm to install the Ingress-Nginx Controller for a Kubernetes cluster.
We install a package known as “chart” from a Helm repository. Initially, there is no repo, and can be seen below:
$ helm repo list Error: no repositories to show
In order to install Ingress-Nginx Controller, I first need to add a new repository.
$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx "ingress-nginx" has been added to your repositories $ helm repo list NAME URL ingress-nginx https://kubernetes.github.io/ingress-nginx
Also, before we install a chart from a repo, it’s a good idea to update the chat repo too.
$ helm repo update Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "ingress-nginx" chart repository Update Complete. ⎈Happy Helming!⎈
Now, we’re ready to install an Nginx chart. The command below was copied from the Quick start page of Ingress-Nginx Controller.
$ helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace
Or using an slighty different command (since we already configured a repo above):
$ helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \ --namespace ingress-nginx --create-namespace
A brief explanation of what the above command actually does.
helm will upgrade an existing
ingress-nginx if it were already installed, otherwise it will be intalled it. The first
ingress-nginx is a custom relase name, we can pick a different name.
--namespace ingress-nginx will install this chart in its own namespace called
ingress-nginx, and this name space will be created if it doesn’t exist.
Check the status of the ingress help deployment using the following command:
$ helm ls -n ingress-nginx NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION ingress-nginx ingress-nginx 1 2023-09-26 22:56:27.274774743 +1000 AEST deployed ingress-nginx-4.8.0 1.9.0
We can check the deployment using
kubectl command. Remember, the chart was deployed into
ingress-nginx namespace, hence it’s necessary to add
-n ingress-nginx to both
$ kubectl get deployments -n ingress-nginx NAME READY UP-TO-DATE AVAILABLE AGE ingress-nginx-controller 1/1 1 1 4m3s
Optionally, to remove the deployment, we can use the following command.
$ helm uninstall ingress-controller