<p>I am learning to deploy applications on private clusters. The application is up and running in a pod and is reachable from the node itself. I have created an ingress controller service as well, but I am not sure what's going wrong. The external IP of the nginx-ingress service always returns 404. Any ideas on the fix ?</p>
<p>Services running :</p>
<p><a href="https://i.stack.imgur.com/7lRiv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7lRiv.png" alt="enter image description here" /></a></p>
<p>Application service :</p>
<p><a href="https://i.stack.imgur.com/vbN7e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vbN7e.png" alt="enter image description here" /></a></p>
<p>Nginx service :</p>
<p><a href="https://i.stack.imgur.com/PeHmM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PeHmM.png" alt="enter image description here" /></a></p>
<p>Application ingress :</p>
<p><a href="https://i.stack.imgur.com/sJ72i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sJ72i.png" alt="enter image description here" /></a></p>
<p>Ingress yaml :
<a href="https://i.stack.imgur.com/hQ3it.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hQ3it.png" alt="enter image description here" /></a></p>

Kshitij Karandikar
<p>Looks like the Ingress is not being served by your Nginx Ingress controller at the moment. If the Ingress is served by a controller, it should have at least one IP Address under its <code>status.loadBalancer</code> (which should be the external IP used by the Ingress Controller which is serving it), while in your case, looks empty like this:</p>
<pre><code>status:
  loadBalancer: {}
</code></pre>
<p>The most common problem on this regard is that the Ingress does not define an Ingress Class or there is no default Ingress Class in the cluster.</p>
<p>First of all, do a <code>k get IngressClass</code> and see if there's any Ingress Class defined. in your cluster. <strong>Depending on the Kubernetes version and Ingress Controller version</strong>, it could make use of IngressClass objects or simply use annotations (or both).</p>
<p>I would try simply adding the annotation <code>kubernetes.io/ingress.class: nginx</code> under the Ingress <code>metadata</code> as the nginx class is usually the one defined by the Nginx Ingress Controller. Or, if your Ingress Controller is using a different Ingress Class, I'd try specify that in the annotation, then your setup <strong>should</strong> work.</p>
<hr />
<p>If you are curious on what is the purpose of an Ingress Class, it can mostly be used to associate an Ingress resource definition, with an ingress controller. On a Kubernetes cluster, there may be more than one Ingress Controller, each one with its own ingress class and Ingress resources are associated to one of them by matching the requested ingress class.</p>
<p>If an ingress class is not specified, the Ingress uses the default one, which means that the IngressClass annotated to be the default one of the cluster is automatically used.</p>
<p>For more info, check the documentation here ( <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class</a> )</p>
