Upgrading Nginx Ingress Controller
To upgrade the Nginx Ingress Controller
Perform the following steps to upgrade the Nginx Ingress Controller from version 1.2.0 to version 1.6.4 or 1.7.0:
Run the following command to get the ingress-class used for the Nginx Ingress Controller version 1.2.0:
kubectl get ds -n ingress-nginx -o yaml | grep -i "\-\-ingress-class"Look for --ingress-class in the command output.
Example: --ingress-class=nginx- Run one of the commands:
To get the deploy.yaml file for Nginx Ingress Controller 1.6.4
$ wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.6.4/deploy/static/provider/cloud/deploy.yamlTo get the deploy.yaml file for Nginx Ingress Controller 1.7.0
$ wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.7.0/deploy/static/provider/cloud/deploy.yaml
- Make sure that the ingress-class (that you verified in step 1) is mentioned in the deploy.yaml file.
Run the following command to delete the jobs (ingress-nginx-admission-create and ingress-nginx-admission-patch):
kubectl delete job ingress-nginx-admission-create ingress-nginx-admission-patch -n ingress-nginx- Make the following changes in the deploy.yaml file:
- Change the kind field of the ingress-nginx-controller from Deployment to DaemonSet
In the args section, set the default certificate to my-tls-secret:
spec:
containers:
- args:
- /nginx-ingress-controller
- --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller
- --election-id=ingress-controller-leader
- --controller-class=k8s.io/ingress-nginx
- --ingress-class=nginx
- --configmap=$(POD_NAMESPACE)/ingress-nginx-controller
- --validating-webhook=:8443
- --validating-webhook-certificate=/usr/local/certificates/cert
- --validating-webhook-key=/usr/local/certificates/key
- --default-ssl-certificate=ingress-nginx/my-tls-secret # <<<<<<<<<<<<<<
Run the command to apply the deploy.yaml:
kubectl apply -f deploy.yamlRun the command to verify that the Nginx Ingress Controller pods are running on all worker nodes:
kubectl -n ingress-nginx get podsRun the command to verify the version of the Nginx Ingress Controller from one of the pod logs:
kubectl logs <ingress controller pod> -n ingress-nginx | lessWhere -n ingress-nginx is the ingress namespace.
The version of the Nginx Ingress Controller must be 1.6.4 or 1.7.0.Run the command to make sure that the same ports of the Nginx Ingress Controller service are configured in the load balancer:
kubectl -n ingress-nginx get service