<p>I am new to Kubernetes and currently deploy an application on AWS EKS.</p>
<p>I want to configure a <code>Service</code> of my K8s cluster deployed on AWS EKS.</p>
<p>Here is the description of my issue: I did an experiment. I spin up <strong>2</strong> Pods running the same web application and expose them using a service (the Service is using <code>LoadBalancer</code> type). Then I got an external IP of that Service. Then and found that requests that I sent were not distributed evenly to every <code>Pod</code> under the <code>Service</code> I created. To be more precise, I sent <strong>3</strong> requests and all the three requests are processed by <strong>the same Pod</strong>.</p>
<p>Therefore, I want to configure the load balancer algorithm to be <code>round robin</code> or <code>least_connection</code> to resolve this issue.</p>
<p>I asked a similar question before and I am suggested to try the IPVS mode of the <code>kube-proxy</code>, but I did not get the detailed instruction on how to apply that config, and did not find any useful material online. If the IPVS mode is a feasible solution to this issue, please provide some detailed instructions.</p>
<p>Thanks!</p>

Xiao Ma
<p>Your expectation from a load balancer is correct, it should distribute the incoming requests. But since you are using a web-socket to perform requests, requests are being handled by the same pod.</p>
<p>A web-socket uses a persistent connection between a client and a server that means the connection is re-used rather than establishing a new connection (costly!). So, you're not getting the load balancing you wanted.</p>
<p>Use something that uses non-persistent connections to check the load balancing feature:</p>
<pre class="lang-sh prettyprint-override"><code>$ curl -H &quot;Connection: close&quot; http://address:port/
</code></pre>
