<p>I am trying to create an ingress controller that points to a service that I have exposed via NodePort.</p>
<p>Here is the yaml file for the ingress controller (taken from <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/</a>):</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: example-ingress
spec:
  rules:
  - host: hello-world.info
    http:
      paths:
      - path: /
        backend:
          serviceName: appName
          servicePort: 80

</code></pre>
<p>I can connect directly to the node port and the frontend is displayed.</p>
<p>Please note that I am doing this because the frontend app is unable to connect to other deployments that I have created and I read that an ingress controller would be able to solve the issue. Will I still have to add an Nginx reverse proxy? If so how would I do that? I have tried adding this to the nginx config file but with no success.</p>
<pre><code>location /middleware/ {
      proxy_pass http://middleware/;
   }
</code></pre>

<p>You must use a proper hostname to reach the route defined in the <code>Ingress</code> object. Either update your <code>/etc/hosts</code> file or use <code>curl -H &quot;hello-world.info&quot; localhost</code> type command. Alternatively, you can delete the <code>host</code> mapping and redirect all traffic to one default service.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: example-ingress
spec:
  rules:
  - http:
      paths:
      - path: /
        backend:
          serviceName: appName
          servicePort: 80
</code></pre>
