<p>I have created a kubernetes cluster using Vagrant. I created a Nginx pod and a Cluster IP service for it. I can curl both the pod and the service getting a successful result. I have now installed an Nginx Ingress Controller from: <a href="https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters</a> and ran the following command:
<code>kubectl create ingress nginxingress --rule=&quot;/nginx=nginx-service:80&quot; --annotation nginx.ingress.kubernetes.io/rewrite-target=/ --default-backend=nginx-service:80</code> and they both have been setup correctly as far as I see as there are no errors. But whenever I try to curl the path then it fails, the controller keeps throwing a 404 Not found.
Some more information that might help:<br />
<strong>services</strong>:<br />
<a href="https://i.stack.imgur.com/B31wM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B31wM.png" alt="enter image description here" /></a>
<strong>ingresses</strong>:<br />
<a href="https://i.stack.imgur.com/wsy8x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wsy8x.png" alt="enter image description here" /></a><br />
any help will be greatly appreciated</p>

<p>Try adding the ingress class annotation to the ingress configuration. <code>kubernetes.io/ingress.class: &quot;nginx&quot;</code></p>
<p>use below YAML as reference and try to update the configuration.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-myserviceb
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - host: myserviceb.foo.org
    http:
      paths:
      - path: /nginx
        pathType: Prefix
        backend:
          service:
            name: nginx-service
            port:
              number: 80
</code></pre>
