How to fix IngressClass not found in Kubernetes
The "IngressClass not found" error occurs when your Ingress resource references an IngressClass that doesn't exist in your cluster. This typically happens when the Ingress controller (like NGINX) hasn't been installed or when there's a mismatch between the configured class name and the actual controller.
Quick fix
Fixes IngressClass not found
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--create-namespace- Verify which Ingress classes are available
- Install NGINX Ingress Controller (most common)
- Create IngressClass manually if controller is installed
- Check your Ingress references the correct class name
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginxhelm repo updatehelm install nginx-ingress ingress-nginx/ingress-nginx \--namespace ingress-nginx \--create-namespaceIngressClass not found
What this error means
An IngressClass is a Kubernetes resource that represents an Ingress controller implementation. When you specify `ingressClassName` in your Ingress resource, Kubernetes looks for a matching IngressClass object. If it doesn't find one, the Ingress resource cannot be processed and returns this error. Since Kubernetes 1.22, IngressClass is required for Ingress resources (the old annotation method is deprecated). The error indicates either the Ingress controller hasn't been deployed, or you're referencing a class name that doesn't match any installed controller.
Typical symptoms
- Ingress resources remain in pending state without an external IP or hostname
- kubectl logs show: "Error when getting IngressClass [name]: ingressclasses.networking.k8s.io [name] not found"
- `kubectl get ingressclass` returns "No resources found"
- Ingress controller pods crash with CrashLoopBackOff or fail to start
- Traffic doesn't route to backend services despite Ingress rules being defined
- Ingress describe shows "Unable to resolve IngressClass" or similar messages
Common causes
- Ingress controller (NGINX, Traefik, etc.) not installed in the cluster
- IngressClass resource created with wrong controller name that doesn't match the actual controller
- Using deprecated `kubernetes.io/ingress.class` annotation instead of `spec.ingressClassName` field in Kubernetes 1.22+
- Kubernetes API version mismatch—using old `networking.k8s.io/v1beta1` instead of `networking.k8s.io/v1`
- IngressClass exists but in wrong namespace or with wrong controller specification
- Missing default IngressClass when Ingress doesn't specify ingressClassName
How to fix "IngressClass not found"
Run kubectl get ingressclass to list all available IngressClass resources. If the list is empty, no Ingress controller is installed. Check what you referenced in your Ingress: kubectl get ingress -A -o jsonpath="{.items[*].spec.ingressClassName}" to see all configured class names.
Using Helm is the easiest method:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--create-namespaceThis automatically creates an IngressClass named "nginx". Verify: kubectl get ingressclass. For other controllers (Traefik, HAProxy, etc.), check their official documentation for Helm charts or manifests.
If your Ingress controller is running but IngressClass doesn't exist, create it:
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: nginx
spec:
controller: k8s.io/ingress-nginxSave as ingressclass.yaml and apply: kubectl apply -f ingressclass.yaml. Verify with kubectl get ingressclass nginx.
Update your Ingress resource to use correct ingressClassName:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
ingressClassName: nginx # Must match your IngressClass name
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: 80Apply: kubectl apply -f ingress.yaml.
If you have multiple IngressClass objects and omit ingressClassName from Ingress specs, Kubernetes uses the default. Mark one as default:
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: nginx
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
controller: k8s.io/ingress-nginxApply: kubectl apply -f ingressclass.yaml. Now Ingress resources without ingressClassName will use this class.
Check if the controller pods are deployed: kubectl get pods -n ingress-nginx (or your controller namespace). All pods should be Running. If they're CrashLoopBackOff, check logs: kubectl logs -n ingress-nginx <pod-name>. For other controllers, check their namespace (e.g., traefik, kube-system).
Ensure your manifests use apiVersion: networking.k8s.io/v1 (not v1beta1). The v1beta1 API is deprecated in Kubernetes 1.22+ and removed in 1.25+. Check your Kubernetes version: kubectl version --short. If using older versions (pre-1.18), use the annotation method instead: kubernetes.io/ingress.class: nginx (without ingressClassName field).
Advanced notes
Different Kubernetes distributions have different default Ingress controllers: Minikube requires enabling with minikube addons enable ingress, Docker Desktop has none by default, Kind requires manual setup. Cloud providers (AWS EKS, Azure AKS, GCP GKE) may provide their own Ingress implementations—check cloud documentation for default controller names. When using Ingress with service mesh (Istio, Linkerd), you may need separate VirtualService/Gateway resources in addition to Ingress. The controller field in IngressClass spec must exactly match what your controller registers—for NGINX it's "k8s.io/ingress-nginx", for others check documentation. ArgoCD and Flux deployments must install Ingress controller before deploying Ingress resources, or use init containers/hooks to ensure ordering.
Frequently asked questions
- What does "IngressClass not found" mean?
- An IngressClass is a Kubernetes resource that represents an Ingress controller implementation. When you specify ingressClassName in your Ingress resource, Kubernetes looks for a matching IngressClass object. If it doesn't find one, the Ingress resource cannot be processed and returns this error.
- How do I fix "IngressClass not found"?
- The "IngressClass not found" error occurs when your Ingress resource references an IngressClass that doesn't exist in your cluster. This typically happens when the Ingress controller (like NGINX) hasn't been installed or when there's a mismatch between the configured class name and the actual controller.
- What causes "IngressClass not found"?
- Ingress controller (NGINX, Traefik, etc.) not installed in the cluster IngressClass resource created with wrong controller name that doesn't match the actual controller Using deprecated kubernetes.io/ingress.class annotation instead of spec.ingressClassName field in Kubernetes 1.22+
- Is the "IngressClass not found" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚Kubernetes Official Documentation
- 📖Kubernetes Docs: ingress(Official Docs)
- 📖Kubernetes Docs: ingress controllers(Official Docs)
- 💬
- 🐙
- 📝