<p>I am testing a Kubernetes cluster version 1.11 and need to make POD to be accessed externally by the master server IP and by the POD port (in this case an nginx image through port 80) and I am trying to enable and configure ingress-nginx to get this access.</p>

<p>To run the tests, I added ingress-nginx to the cluster with the command:</p>

<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
</code></pre>

<p>Then I tried to create an ingress as described in this example: 
<a href="https://koudingspawn.de/install-kubernetes-ingress/" rel="nofollow noreferrer">https://koudingspawn.de/install-kubernetes-ingress/</a> - I just did not do the LoadBalancer portion of Digital Ocean.</p>

<p>It happened that it did not work, I could not access the IP or host configured and because of this, I was in doubt if I made the right addition of ingress-nginx in the cluster, if the example has a failure or if I have to follow another path?</p>

<p>Neither of the canonical approaches will give you exactly what you want here.</p>

<p>The typical solution involves either using LoadBalancer service type or NodePort and manualy configuring your network LB to point to the ports of the NodePort service.</p>

<p>I will make 3 assumptions here :</p>

<ul>
<li>you have no LB service available so you want to connect with HTTP(S) to the IP of your master</li>
<li>your master hosts kube api on port like 6443, or anything else but 80/443 that you want to use for web traffic</li>
<li>you are talking about single master and using it for the traffic. It's an obvious SPOF, so I assume you do not care about HA that much</li>
</ul>

<p>With that in mind, you need to adapt your ingress deployment to fit your needs.</p>

<p>Nginx ingress, within it's network namespace, listens on standard ports (80/443). If, instead of exposing it with a <code>Service</code>, you run tham with <code>hostNetwork: true</code>, you will see the ingress listening directly on 80/443. To be certain it's running on your master, you need to allow it to be scheduled on master (probably via tolerations) and make sure it is scheduled on master and not some other node (nodeSelector/NodeAffinity or DaemonSet to run it on ~every node in cluster)</p>

<p>Another solution can be to actually go the canonical way and have the ingress listening on some nodeports, and then have another piece of software act as loadbalancer deployed to master either by means of kube (<code>hostNetwork</code>) or by completely autonomous mechanism (ie. as systemd service unit), that would listen on 80/443 and tcp forward the traffic to the nodeports.</p>
