Archive · Kubernetes

IngressClass and ingress-nginx 1.0

ingress-nginx 1.0 requires the networking.k8s.io/v1 API and works through IngressClass.

1 min read

  • ingress-nginx 1.0
  • Kubernetes 1.22
  • IngressClass

With ingress-nginx 1.0 the project dropped support for the removed Ingress beta APIs, so it needs Kubernetes 1.19 or later, and it selects ingresses with an IngressClass.

apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata: { name: nginx }
spec:
  controller: k8s.io/ingress-nginx
spec:
  ingressClassName: nginx      # replaces the old kubernetes.io/ingress.class annotation
  rules: [...]

Upgrade checklist:

  1. Move every Ingress to networking.k8s.io/v1.
  2. Replace the kubernetes.io/ingress.class annotation with ingressClassName.
  3. Run the upgrade in a test cluster and compare generated config.
  4. Review annotations such as rewrite-target, which behave differently with path regexes.
kubectl get ingressclass
kubectl describe ingress site

If an ingress shows no address, check that its class matches a controller that is actually running.