<p>We use a headless service to balance traffic, but progers do not like this option. Installed istio, I read the documentation, but my eyes run wide.</p>
<p>Now the task is:
Balance traffic to the service, in my case: <code>results-service2.predprod.svc.cluster.local</code></p>
<p>Do I understand correctly that it is enough for me to create a <code>DestinationRule</code> and all incoming traffic to <code>results-service2.predprod.svc.cluster.local</code> will be balanced on replicas using the <code>LEAST_CONN</code> balancing algorithm?</p>
<p>In my case:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: results-load-balancer
spec:
  host: results-service2.predprod.svc.cluster.local
  trafficPolicy:
      loadBalancer:
        simple: LEAST_CONN
</code></pre>

Maksim
<p>Istio destination rule is place to define service load balancing algorithm.  By default istio uses &quot;LEAST_REQUEST&quot; as LB algorithm.  &quot;LEAST_CONN&quot; is deprecated algorithm.  More details are mentioned in <a href="https://istio.io/latest/docs/reference/config/networking/destination-rule/#LoadBalancerSettings-SimpleLB" rel="nofollow noreferrer">istio documentation</a>.  If you would like to change LB algorithm to &quot;ROUND_ROBIN&quot; or another supported methon this can be done as per below sample</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: configure-client-mtls-dr-with-workloadselector
spec:
  host: example.com
  workloadSelector:
    matchLabels:
      app: ratings
  trafficPolicy:
    loadBalancer:
      simple: ROUND_ROBIN
</code></pre>
