<p>I have an two container in same namespace. Service-A &amp; Service-B.</p>

<p>And in my case, i want to talk to Service-B from Service-A. Through RestTemplate, i am making post call for communication like below.</p>

<pre><code>public Response fetchData(Request request) {
   return restTemplate.postForEntity("http://Service-B:8080/api", request, Response.class).getBody();
}
</code></pre>

<p>It is working fine in my lower region as i have only one POD for Service-B. My doubt here is, if i have more PODS (lets say three POD) in Production for handling load. Will the load balancing happen between PODS, if i use service url instead of router url?</p>

Mohan
<p>If using kubernetes service then kube-proxy component provides load balancing at L4 layer via linux iptables.</p>

<p>Kube proxy running in IPVS mode provides least conns, locality, weighted, persistence based load balancing</p>

<p>Kube proxy running in userspace or iptables mode provides round robin load balancing</p>

<p>But if you need advanced loadbalancing at L7 layer then you need to use ingress or router.</p>

<p><a href="https://kubernetes.io/docs/concepts/services-networking/#the-gory-details-of-virtual-ips" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/#the-gory-details-of-virtual-ips</a></p>
