<p>I am having hard time in understanding the role of a Load Balancer when used with Ingress Nginx.</p>
<p>I know a Load balancer distributes request over multiple nodes.</p>
<p>i.g,  let's say I have two nodes A and B , and they are responisble for processing requests at <code>example.com</code>.</p>
<p>So a load balancer will take request for <code>example.com</code> and distribute among them with help of defined algorithm.</p>
<p>I also understand what an API Gateway is,</p>
<p>i.g., let's say I have one <code>order</code> service and another <code>payment</code> service so an API gateway will get the request for <code>example.com</code> and it will hand over the request for <code>/orders</code> to <code>order</code> service and <code>/payments</code> to <code>payment</code> service.</p>
<p>The Confusion:</p>
<pre><code>Load Balancer(NLB) -&gt; API Gateway -&gt; Services -&gt; order deployment -&gt; which is running two replicas
</code></pre>
<ol>
<li>Who distributes requests in those replicas for <code>/orders</code></li>
<li>What is the role of load balancer in this case?</li>
<li>Some article suggest to create a service as type Load Balancer what does that mean? What this service will do?</li>
<li>Also, Load Balancer sits outside of the cluster <code>NLB -&gt; [ k8s cluster ]</code>, how does it know how to distribute requests?</li>
</ol>
<p>These collectely could one question, I don't know.</p>
<p>Any kind of explanation would appreciated.</p>
<p>I have gone through many articles and blogs but none talks about complete picture.</p>
<p><strong>Update</strong></p>
<p>Many of my doubts are cleared through this <a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="nofollow noreferrer">article</a></p>
<p><em>Within the cluster a service does load balancing among the replicas.</em>
<a href="https://stackoverflow.com/questions/48789227/does-clusterip-service-distributes-requests-between-replica-pods">Source</a></p>
<p>I still have some questions,</p>
<p>Do I only  need a load balacner to expose the ingress controller service?</p>
<p>What if there is some problem with the ingress controller and it restarts.</p>
<p>What will happen will it get a new IP and load balancer will poin to new one or the ip will remain the same?</p>

Magnetaar
<p>This article may help : <a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/</a></p>
<p>Q: Do I only need a load balacner to expose the ingress controller service?
A: Expose K8s services mainly</p>
<p>Q: What if there is some problem with the ingress controller and it restarts.
A: Problem can appear if new broken changes will be applied, and in this case old controller will still work, but new one will fail to start, therefore you will have to do kubectl describe etc, to understand what is wrong.</p>
<p>Q: What will happen will it get a new IP and load balancer will poin to new one or the ip will remain the same?
A: Why you need LB ip's? Use LoadBalancer DNS.</p>
