<p>I want to create an ingress for the kubernetes dashboard, but it loads forever inside the browser: Mac</p>
<pre><code>minikube start --driver=docker
</code></pre>
<pre><code>minikube addons enable ingress
</code></pre>
<pre><code>minikube addons enable ingress-dns
</code></pre>
<pre><code>minikube addons enable dashboard
</code></pre>
<pre><code>minikube addons enable metrics-server
</code></pre>
<pre><code>❯ kubectl get ns
NAME                   STATUS   AGE
default                Active   4m13s
ingress-nginx          Active   109s
kube-node-lease        Active   4m14s
kube-public            Active   4m14s
kube-system            Active   4m14s
kubernetes-dashboard   Active   51s
</code></pre>
<pre><code>
❯ kubectl get service -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
dashboard-metrics-scraper   ClusterIP   10.105.2.220     &lt;none&gt;        8000/TCP   82s
kubernetes-dashboard        ClusterIP   10.106.101.254   &lt;none&gt;        80/TCP     82s
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>// dashboard-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - host: dashboard.com
    http:
      paths:
      - path: /
        pathType: Exact  
        backend:
          service:
            name: kubernetes-dashboard
            port: 
              number: 80
</code></pre>
<pre><code>❯ kubectl apply -f dashboard-ingress.yaml
ingress.networking.k8s.io/dashboard-ingress created
</code></pre>
<pre><code>❯ kubectl get ingress -n kubernetes-dashboard
NAME                CLASS    HOSTS           ADDRESS        PORTS   AGE
dashboard-ingress   &lt;none&gt;   dashboard.com   192.168.49.2   80      67s
</code></pre>
<pre><code>// etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
192.168.49.2    dashboard.com
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
~                    
</code></pre>
<p>When I now try to load dashboard.com or also 192.168.49.2 in the browser, it just loads forever and does nothing.
When i try to load <a href="http://127.0.0.1/" rel="nofollow noreferrer">http://127.0.0.1/</a> I get a nginx 404</p>
<p>Am I missing something?</p>

Don
<p>The ingress addon is currently not fully supported on docker driver on MacOs (due the limitation on docker bridge on mac) you need to use <code>minikube tunnel</code> command. <a href="https://minikube.sigs.k8s.io/docs/drivers/docker/#known-issues" rel="nofollow noreferrer">Minikube docs - Known isses</a>, <a href="https://github.com/kubernetes/minikube/issues/13795" rel="nofollow noreferrer">GitHub issue</a></p>
<p>Enabling the ingress addon on Mac shows that the ingress will be available on 127.0.0.1. <a href="https://github.com/kubernetes/minikube/pull/12089" rel="nofollow noreferrer">Support Ingress on MacOS, driver docker</a></p>
<p>So you only need to add the following line to your /etc/hosts file.</p>
<pre><code>127.0.0.1  dashboard.com
</code></pre>
<p>Create tunnel (it will ask your sudo password)</p>
<pre><code>minikube tunnel
</code></pre>
<p>Then you can verify that the Ingress controller is directing traffic:</p>
<pre><code>curl dashboard.com
</code></pre>
<p>(also I used this Ingress)</p>
<pre class="lang-bash prettyprint-override"><code>kubectl apply -f - &lt;&lt; EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: dashboard.com
    http:
      paths:
        - pathType: Prefix
          path: &quot;/&quot;
          backend:
            service:
              name: kubernetes-dashboard
              port:
                number: 80    
EOF
</code></pre>
