ingress-nginx controller stops working after upgrading Kubernetes to 1.22 or later
Ingress manifests using extensions/v1beta1 are rejected after a Kubernetes upgradeShort answer
Kubernetes 1.22 stopped serving the extensions/v1beta1 and networking.k8s.io/v1beta1 Ingress APIs. An old controller release or old manifests that still use them break on upgrade. Move manifests to networking.k8s.io/v1, then upgrade the controller to a release that supports your cluster version.
Fix it fast
1Find out which cause you have
Check the controller's logs and the image version, then list which Ingress API versions your manifests use.
kubectl -n ingress-nginx get pods kubectl -n ingress-nginx logs deploy/ingress-nginx-controller --tail=50 grep -rn "apiVersion: .*v1beta1" .2Match what you see, then jump to its fix
- 1
kubectl apply or helm fails on kind Ingress with extensions/v1beta1 or networking.k8s.io/v1beta1The manifests still use the removed Ingress API versionsFix - 2
The controller pod crashes or does not become ready right after the control plane upgradeThe controller release is older than the cluster supportsFix
- 1
What does the error look like?
Ingress manifests using extensions/v1beta1 are rejected after a Kubernetes upgradeingress-nginx controller does not start after an AKS upgrade to 1.22
Cause 1 of 2
The manifests still use the removed Ingress API versions
1Check
The Kubernetes deprecation guide lists both versions as no longer served from 1.22. The replacement networking.k8s.io/v1 has been available since 1.19.
grep -rn "extensions/v1beta1\|networking.k8s.io/v1beta1" .2Fix
Migrate each Ingress: pathType is now required, backend becomes defaultBackend, serviceName and servicePort become service.name and service.port.number, and ingressClassName replaces the old class annotation.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
spec:
ingressClassName: nginx
rules:
- host: foo.example.com
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo
port:
number: 803Verify
Apply the manifest and read it back from the cluster.
kubectl apply -f ingress.yaml
kubectl get ingressConfirmed by kubernetes.io
Cause 2 of 2
The controller release is older than the cluster supports
1Check
The ingress-nginx project publishes a table of which controller versions support which Kubernetes versions, with the matching Helm chart. Compare it with what you run.
kubectl -n ingress-nginx get deploy ingress-nginx-controller -o jsonpath='{.spec.template.spec.containers[0].image}'
kubectl version
helm list -n ingress-nginx2Fix
Upgrade the Helm release to a chart whose controller version supports your Kubernetes version. Note that the project's README says it is being retired, so plan a move to a maintained ingress controller too.
helm repo update
helm upgrade ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx --reuse-values3Verify
The controller pod is Running and ready.
kubectl -n ingress-nginx get podsConfirmed by github.com
How do I stop it coming back?
- Read the Kubernetes deprecation guide before every minor upgrade and scan manifests for removed API versions.
- Upgrade the ingress controller before the control plane when its table says the new version needs it.
- Keep Ingress manifests in Git so they can be searched and migrated in one change.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- stegnor.comMy company site: 804 pages from a Python and Jinja generator, with 15 free browser tools.
Related fixes
Servers
Kubernetes Ingress returns 404 for a path other than /
404 Not Found nginx on /app but / works
The ingress matches /app, but the backend still receives /app and has no route there, so it answers 404.
3 causes, each with a fixServers
Argo CD behind an nginx Ingress loops with too many redirects
307 Temporary Redirect on every request to the Argo CD host
The browser and Argo CD disagree about who handles TLS.
3 causes, each with a fixServers
Uploads larger than 1 MB fail with 413 behind the Kubernetes NGINX Ingress controller
Uploads of a few MB fail, small files work
The ingress-nginx controller limits request bodies to 1m by default and answers 413 above that.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
Azure App Service on Linux restarts the container and the site never starts
The container restarts again and again and the site returns an application error
App Service sends a warmup request to the container and restarts it if no HTTP answer comes back in time.
5 causes, each with a fixServers
Azure Application Gateway: intermediate certificate is missing
Chain is incomplete when the gateway's certificate is tested with openssl s_client or an SSL checker
Application Gateway sends only what you give it.
3 causes, each with a fix