install nginx ingress on AKS 1.21.7

2/24/2022

Recently, I upgraded my Azure Kubernetes Cluster from 1.19.11 to 1.21.7. Subsequently, I am upgrading nginx ingress on the cluster

[]$ helm list -A | grep nginx-ingress
nginx-ingress   ingress-basic   1               2021-01-18 13:07:23.842072063 +0000 UTC deployed        ingress-nginx-3.15.2            0.41.2


$ kubectl exec -it nginx-ingress-ingress-nginx-controller-85b8676f7d-8qjw5 -n ingress-basic sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/etc/nginx $ nginx -v
nginx version: nginx/1.19.4
/etc/nginx $

I want to upgrade nginx to 1.20.0 plus version. Do we need to specify the version in command below?

helm upgrade --install ingress-basic ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace nginx-ingress --create-namespace
 kubectl describe pod nginx-ingress-ingress-nginx-controller-65b69d4895-d4cft -n ingress-basic | grep Image:
    Image:        demoacr.azurecr.io/nginx-ingress-controller:nginx-0.35.0-rancher2
-- Satyam Pandey
kubernetes
kubernetes-helm
nginx
nginx-ingress

1 Answer

2/24/2022

To upgrade your ingress-nginx installation to a specific version, you can set the flag --version, as specified in Helm docs:

helm upgrade [RELEASE] [CHART] [flags]
--version string specify a version constraint for the chart version to use. 
This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). 
If this is not specified, the latest version is used

The command should look like this:

helm upgrade --install ingress-basic ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace nginx-ingress --create-namespace \
  --version 1.20.0

It is worth mentioning, that you can also upgrade your nginx installation without Helm by changing the version of the image in your controller Deployment - just change the image tag to the version you wish to upgrade to - v1.20.0 . More details about it in Upgrade NGINX Ingress Controller.

-- anarxz
Source: StackOverflow