<p>I have been running an application stack successfully on a server using the <em>k3s</em> Kubernetes implementation. I am now attempting to deploy it on my Windows PC in Docker Desktop. I get a <strong>404 not found</strong> when accessing the application on the localhost.</p>
<ul>
<li>I tried using 'localhost', '127.0.0.1' and
'kubernetes.docker.internal' (the latter is assigned to 127.0.0.1 by
Docker Desktop on installation) - none work.</li>
<li>I have tried all these
host names with ports 80, 8000, 443, 8443, etc. No luck.</li>
</ul>
<p>I'm using <em>Traefik</em> as my ingress controller, with TLS switched on, certificates are issued by cert-manager. For the local deployment, I use the cert-manager <em>self-signed</em> option. I have also <em>removed</em> the TLS spec from my ingress, but it makes no difference.</p>
<p>Here is my ingress definition, using 'kubernetes.docker.internal' as host:</p>
<pre><code>    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: traefik-ingress
      annotations:
        kubernetes.io/ingress.class: &quot;traefik&quot;
        cert-manager.io/issuer: self-signed
    spec:
      tls:
        - secretName: s3a-tls-certificate-secret
          hosts:
            - kubernetes.docker.internal
      rules:
      - http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: s3a-frontend
                  port:
                    number: 80
</code></pre>
<ul>
<li>When I try http<strong>s</strong>://kubernetes.docker.internal (implied port 443), on first attempt, Chrome shows me the &quot;unsafe self-signed certificate, press Advanced to continue&quot; stuff, but when I do continue, I get 404 page not found.</li>
<li>When I try plain <a href="http://kubernetes.docker.internal" rel="nofollow noreferrer">http://kubernetes.docker.internal</a> (implied port 80), I get Chrome ERR_EMPTY_RESPONSE.</li>
<li>When I remove the TLS stuff completely from the ingress, it does exactly the same as above for ports http and https.</li>
<li>You'll see the spec/rules don't specify a specific host, i.e. the spec applies to <em>all</em> hosts. I've tried fixing it to host 'kubernetes.docker.internal', but as expected, it makes no difference.</li>
</ul>
<p>The target service &quot;s3a-frontend&quot; is running on its exposed port 80: <em>I can access it</em> when hitting it directly on its node port, but <em>not via the ingress</em>.</p>
<p>EDIT:
The Traefik ingress controller comes with k3s, but I installed it manually in Docker Desktop. When I attach to the traefik pod, I can see a request being logged when I access <a href="https://kubernetes.docker.internal" rel="nofollow noreferrer">https://kubernetes.docker.internal</a>, here are the logs. You can see the cluster health checks (&quot;ping@internal&quot;), but also my request for root (&quot;/&quot;) and then Chrome's request for favicon, neither of which return a response code.</p>
<pre><code>10.1.0.1     - - [05/Nov/2021:16:36:23 +0000] &quot;GET /ping HTTP/1.1&quot; 200 2 &quot;-&quot; &quot;-&quot; 2141 &quot;ping@internal&quot; &quot;-&quot; 0ms
192.168.65.3 - - [05/Nov/2021:16:36:24 +0000] &quot;GET / HTTP/2.0&quot; - - &quot;-&quot; &quot;-&quot; 2142 &quot;-&quot; &quot;-&quot; 0ms
10.1.0.1     - - [05/Nov/2021:16:36:24 +0000] &quot;GET /ping HTTP/1.1&quot; 200 2 &quot;-&quot; &quot;-&quot; 2143 &quot;ping@internal&quot; &quot;-&quot; 0ms
192.168.65.3 - - [05/Nov/2021:16:36:24 +0000] &quot;GET /favicon.ico HTTP/2.0&quot; - - &quot;-&quot; &quot;-&quot; 2144 &quot;-&quot; &quot;-&quot; 0ms
</code></pre>
<p>/END EDIT</p>
<p>I have done a lot of research, including on the possibility that something else is hogging ports 80/443. netstat says that <em>Docker itself</em> is listening on those ports: how can I claim those ports if Docker itself is using it, or is this a red herring?</p>
<p><strong>System</strong></p>
<ul>
<li>Windows 10 Pro, 10.0.19043</li>
<li>WSL2</li>
<li>Docker Desktop reports engine v20.10.8</li>
</ul>

Cornel Masson
<p>I couldn't get this working on Docker Desktop. I switched to <a href="https://rancherdesktop.io/" rel="nofollow noreferrer">Rancher Desktop</a> and it worked.</p>
