<blockquote>
  <p>OS: RHEL7 | k8s version: 1.12/13 | kubespray | baremetal</p>
</blockquote>

<p>I have a standard kubespray bare metal cluster deployed and I am trying to understand what is the simplest recommended way to deploy nginx-ingress-controller that will allow me to deploy simple services. There is no load balancer provided. I want my MASTER public IP as the endpoint for my services.</p>

<p><a href="https://i.stack.imgur.com/GKWjG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GKWjG.png" alt="look-up"></a></p>

<p>Github k8s ingress-nginx <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md#bare-metal" rel="nofollow noreferrer">suggests</a> NodePort service as a "mandatory" step, which seems not to be enough to make it works along with kubespray's <em>ingress_controller</em>.</p>

<p>I was able to make it working forcing LoadBalancer service type and setting externalIP value as a MASTER public IP into nginx-ingress-controller via <code>kubectl edit svc</code> but it seems not to be a correct solution due to lack of a load balancer itself.</p>

<p>Similar results using helm chart:</p>

<pre><code>helm install -n ingress-nginx stable/nginx-ingress --set controller.service.externalIPs[0]="MASTER PUBLIC IP"
</code></pre>

YasiuMaster
<blockquote>
  <p>I was able to make it working forcing LoadBalancer service type and setting externalIP value as a MASTER public IP into nginx-ingress-controller via kubectl edit svc but it seems not to be a correct solution due to lack of a load balancer itself.</p>
</blockquote>

<p>Correct, that is not what <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a> is intended for. It's intended for provisioning load balancers with cloud providers like AWS, GCP, or Azure, or a load balancer that has some sort of API so that the kube-controller-manager can interface with it. If you look at your kube-controller-manager logs you should see some errors.  The way you made it work it's obviously a hack, but I suppose it works.</p>

<p>The standard way to implement this is just to use a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">NodePort</a> service and have whatever proxy/load balancer (i.e. nginx, or haproxy) on your master to send traffic to the NodePorts. Note that I don't recommend the master to front your services either since it already handles some of the critical Kubernetes pods like the kube-controller-manager, kube-apiserver, kube-scheduler, etc.</p>

<p>The only exception is <a href="https://metallb.universe.tf" rel="nofollow noreferrer">MetalLB</a> which you can use with a LoadBalancer service type. Keep in mind that as of this writing the project is in its early stages.</p>
