<p>I created the following ingressClass while my ingress-nginx controller was already running:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: IngressClass
metadata:
  name: nginx
  annotations:
    ingressclass.kubernetes.io/is-default-class: &quot;true&quot;
spec:
  controller: example.com/ingress-nginx-controller
</code></pre>
<p>And all works well, newly created ingresses get assigned the &quot;nginx&quot; ingress class automatically and my ingress nginx controller handles them as expected.</p>
<p>However, upon restarting the ingress-nginx-controller pod, I receive the following error in its logs &amp; it keeps:</p>
<pre><code>I1206 05:23:22.968400       8 main.go:115] &quot;Enabling new Ingress features available since Kubernetes v1.18&quot;
E1206 05:23:22.971801       8 main.go:134] Invalid IngressClass (Spec.Controller) value &quot;quivr.be/ingress-nginx-controller&quot;. Should be &quot;k8s.io/ingress-nginx&quot;
F1206 05:23:22.971832       8 main.go:135] IngressClass with name nginx is not valid for ingress-nginx (invalid Spec.Controller)
</code></pre>

Frederik Baetens
<p>This error occurs because the spec.controller field of the IngressClass resource cannot contain just any domain name. The domain name &amp; controller name is specific to the ingress controller you deploy.</p>
<p>For the ingress-nginx controller this needs to be <strong>k8s.io/ingress-nginx</strong> as directed in the error logs.</p>
<p>For other controllers like nginx ingress (not the same as ingress-nginx) this should be nginx.org/ingress-controller as directed here: <a href="https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/common/ingress-class.yaml" rel="noreferrer">https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/common/ingress-class.yaml</a></p>
<p>p.s. I know this seems really obvious in hindsight because the solution is literally in the error logs, but being able to google this error would have saved very tired me some time.</p>
