<p>I have Docker Desktop (Windows) installed, and have turned on Kubernetes.</p>
<p>I've installed the Nginx ingress controller by running the following command:</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/cloud/deploy.yaml
</code></pre>
<p>(<a href="https://kubernetes.github.io/ingress-nginx/deploy/#docker-desktop" rel="nofollow noreferrer">above command from docs</a>)</p>
<p>I've applied the following YAML...</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: blah
spec:
  replicas: 1
  selector:
    matchLabels:
      app: blah
  template:
    metadata:
      labels:
        app: blah
    spec:
      containers:
      - name: blah
        image: tutum/hello-world
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
---

apiVersion: v1
kind: Service
metadata:
  name: blah
spec:
  type: NodePort
  ports:
  - name: http
    port: 80
    targetPort: 80
    nodePort: 30010
  selector:
    app: blah

---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: blah
spec:
  defaultBackend:
    service:
      name: blah
      port:
        name: http
  rules:
  - host: kubernetes.docker.internal
    http:
      paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: blah
              port:
                name: HTTP
</code></pre>
<p>If I do a GET request from my Windows machine <code>http://kubernetes.docker.internal/</code> - I get this...</p>
<p><a href="https://i.stack.imgur.com/L9XX6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9XX6.png" alt="enter image description here" /></a></p>
<p>The above, I'd expect to hit my pod.</p>
<p>If I do a get on a non-existent URL (eg. 'http://kubernetes.docker.internal/nonexistant'), I get an NGINX 404.</p>
<p>If I do it on the HTTPS version 'https://kubernetes.docker.internal' - I also get a 404.</p>
<p>If I access it via the NodePort 'http://kubernetes.docker.internal:30010', then it works as expected because it's not using the ingress.</p>
<p>It's almost as if the Nginx Controller has been installed, but any requests are just hitting Nginx directly, and ignoring any ingresses I create.</p>
<p>I'm sure I'm missing something fundamental - but any ideas about what I'm doing wrong?</p>
<h1>Update</h1>
<p>Following on from @clarj's comment, I looked at the nginx controller logs, and saw the following error: &quot;ingress does not contain a valid IngressClass&quot;. So I've added the following to the ingress...</p>
<pre><code>  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
</code></pre>
<p>This has got rid of the error, but not fixed the problem.</p>
<p>Here are my logs now...</p>
<pre><code>-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       v1.0.4
  Build:         9b78b6c197b48116243922170875af4aa752ee59
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.19.9

-------------------------------------------------------------------------------

W1014 18:13:38.886167       7 client_config.go:615] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I1014 18:13:38.886636       7 main.go:221] &quot;Creating API client&quot; host=&quot;https://10.96.0.1:443&quot;
I1014 18:13:38.890654       7 main.go:265] &quot;Running in Kubernetes cluster&quot; major=&quot;1&quot; minor=&quot;21&quot; git=&quot;v1.21.4&quot; state=&quot;clean&quot; commit=&quot;3cce4a82b44f032d0cd1a1790e6d2f5a55d20aae&quot; platform=&quot;linux/amd64&quot;
I1014 18:13:38.979187       7 main.go:104] &quot;SSL fake certificate created&quot; file=&quot;/etc/ingress-controller/ssl/default-fake-certificate.pem&quot;
I1014 18:13:38.987243       7 ssl.go:531] &quot;loading tls certificate&quot; path=&quot;/usr/local/certificates/cert&quot; key=&quot;/usr/local/certificates/key&quot;
I1014 18:13:38.992390       7 nginx.go:253] &quot;Starting NGINX Ingress controller&quot;
I1014 18:13:38.995200       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;ConfigMap&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller&quot;, UID:&quot;4865a09a-18fe-4760-a466-742b63ab480f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;14917&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/ingress-nginx-controller
I1014 18:13:40.095580       7 store.go:371] &quot;Found valid IngressClass&quot; ingress=&quot;default/blah&quot; ingressclass=&quot;nginx&quot;
I1014 18:13:40.095725       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;default&quot;, Name:&quot;blah&quot;, UID:&quot;389b024c-9148-4ed0-83b6-a8be5e241655&quot;, APIVersion:&quot;networking.k8s.io/v1&quot;, ResourceVersion:&quot;25734&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
I1014 18:13:40.193521       7 nginx.go:295] &quot;Starting NGINX process&quot;
I1014 18:13:40.193677       7 leaderelection.go:243] attempting to acquire leader lease ingress-nginx/ingress-controller-leader...
I1014 18:13:40.193757       7 nginx.go:315] &quot;Starting validation webhook&quot; address=&quot;:8443&quot; certPath=&quot;/usr/local/certificates/cert&quot; keyPath=&quot;/usr/local/certificates/key&quot;
I1014 18:13:40.193876       7 controller.go:152] &quot;Configuration changes detected, backend reload required&quot;
I1014 18:13:40.195273       7 status.go:84] &quot;New leader elected&quot; identity=&quot;ingress-nginx-controller-5c8d66c76d-4gfd4&quot;
I1014 18:13:40.213501       7 controller.go:169] &quot;Backend successfully reloaded&quot;
I1014 18:13:40.213577       7 controller.go:180] &quot;Initial sync, sleeping for 1 second&quot;
I1014 18:13:40.213614       7 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5c8d66c76d-fb79x&quot;, UID:&quot;69db0f7e-0137-48ee-b4aa-fc28d5208423&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;25887&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I1014 18:14:23.192016       7 leaderelection.go:253] successfully acquired lease ingress-nginx/ingress-controller-leader
I1014 18:14:23.192035       7 status.go:84] &quot;New leader elected&quot; identity=&quot;ingress-nginx-controller-5c8d66c76d-fb79x&quot;
</code></pre>
<h1>Update 2</h1>
<p>Actually, the fix in my 'Update' above did work. I just needed to use HTTP in my GET request.</p>

<p>I worked it out, after a hint from @clarj about checking the Nginx Controller pod logs.</p>
<p>Turned out I was missing the following annotation from my ingress...</p>
<pre><code>  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
</code></pre>
<p>(see my 'Update' in my initial post)</p>
<p>After that fix - the GET request that had HTTPS then worked.</p>
