<p>We are analyzing the integration of the <a href="https://kubernetes.io/" rel="nofollow noreferrer">Kubernetes</a> service in our on premise environment. We have SaaS based services which can be exposed publicly. </p>

<p>We have doubts in setting up the external endpoints for the services. Is there any way to create the external endpoints for the services?</p>

<p>We have tried to setup the <code>ExternalIP</code> parameter in the services with the master node IP address. Not sure this is the correct way. Once we setup the external IP with the master node IP address we are able to access the services.</p>

<p>We have also tried with ingress controllers and also there we can access our services with the IP address of the node where the ingress controllers are running.</p>

<p>For Example :</p>

<pre><code>Public IP : XXX.XX.XX.XX
</code></pre>

<p>Ideally, we would map the public IP with the load balancer virtual IP, but we cannot find such a setting in Kubernetes.</p>

<p>Is there any way to address this issue?</p>

<p>My suggestion is to use an Ingress Controller that acts as a proxy for all your services in kubernetes.</p>

<p>Of course your ingress controller has to be somehow exposed to the outside world. My suggestion is to use the <code>hostNetwork</code> setting for the ingress controller pod (this way, the pod will be listening on your host's physical interface, like any other "traditional" service). </p>

<p>A few resources:</p>

<ul>
<li><a href="http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/" rel="nofollow noreferrer">Here</a> details on how a pod can be reached from outside your k8s cluster).</li>
<li><a href="https://medium.com/@samwalker505/using-kubernetes-ingress-controller-from-scratch-35faeee8eca" rel="nofollow noreferrer">Here</a> a nice tutorial on how to setup an ingress controller on k8s.</li>
</ul>

<p>If you have more than one minion in your cluster, you'll end up having problems with load balancing them. <a href="https://serverfault.com/questions/869413/whats-the-common-practice-of-managing-the-external-ip-of-a-docker-swarm/869506#869506">This question</a> can be helpful about that.</p>
