<p>I have a single node Kubernetes instance from <a href="https://microk8s.io/" rel="noreferrer">microk8s</a>. It is installed on a Ubuntu Server 20.20 running on Raspberry Pi 4.</p>
<p>I am tring to setup an ingress resource which cannot get working.</p>
<p>When I run <code>kubectl describe ingress my-ingress</code> I get this output</p>
<pre><code>Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
</code></pre>
<p>From what I found in the internet, <code>default-http-backend</code> is something that should have been there by default, but when I run <code>kubectl get pods -n kube-system</code> I don't see it.</p>
<p><strong>Question:</strong> How to enable <code>default-http-backend</code> in mikrok8s? Or more generally, how do I make ingress work?</p>
<p>Note: Ingress and DNS addons are enabled.</p>

<p>The <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules" rel="noreferrer">default backend</a> is a fallback for when the ingress controller cannot match any of the rules.</p>
<h2><code>apiVersion: networking.k8s.io/v1</code></h2>
<pre class="lang-yaml prettyprint-override"><code>spec:
  defaultBackend:
    service:
      name: tea-svc
      port:
        number: 80
</code></pre>
<p>Here is a complete example using <code>v1</code></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
spec:
  defaultBackend:
    service:
      name: tea-svc
      port:
        number: 80
  rules:
    - host: cafe.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: tea-svc
                port:
                  number: 80
</code></pre>
<h2><code>apiVersion: networking.k8s.io/v1beta1</code></h2>
<p>Depending on the <code>apiVersion</code> of your yaml file, the default backend is specified in a different format.  It looks like you are using the beta format.</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
    backend:
        serviceName: tea-svc
        servicePort: 80
</code></pre>
<p>The NGINX Ingress Controller complains about <code>v1beta1</code>, so far it works in kubernetes 1.21.2, but as the warning says it won't soon:</p>
<pre><code>networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
</code></pre>
