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.
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.
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).
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.
No subnets found for EKS cluster
How to fix "eks subnet not found" in Kubernetes
unable to compute replica count
How to fix "unable to compute replica count" in Kubernetes HPA
error: context not found
How to fix "error: context not found" in Kubernetes
default backend - 404
How to fix "default backend - 404" in Kubernetes Ingress
serviceaccount cannot list resource
How to fix "serviceaccount cannot list resource" in Kubernetes