<p>I'm trying to deploy a simple nginx ingress object in my local kubernetes (Docker-Desktop) but I noticed that the class name is showing as &quot;none&quot; when I do:</p>
<pre><code>➜  localk8 k get ingress
NAME               CLASS    HOSTS   ADDRESS     PORTS   AGE
ingress-resource   none   *       localhost   80      15m
</code></pre>
<p>My ingress definition file is defined as:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  rules:
  - http:
      paths:
      - path: /hello
        pathType: Prefix
        backend:
          service:
            name: hello-app
            port:
              number: 8080
</code></pre>
<p>I'm also running on a M1 macbook if that makes any difference. Thanks all for the help!</p>

<p>I am not sure what version of kubernetes you're using, but that annotation was <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation" rel="noreferrer">deprecated in 1.18</a>.</p>
<p>Also, you need to <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation" rel="noreferrer">define an <code>IngressClass</code> resource that describes the class</a> and then reference it with the new field <code>ingressClassName</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  name: nginx
spec:
  controller: example.com/ingress-controller
</code></pre>
<p>Then in your ingress resource add the new field under spec and reference the class name:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  // use new field
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - path: /hello
        pathType: Prefix
        backend:
          service:
            name: hello-app
            port:
              number: 8080
</code></pre>
