Locality LoadBalacing not working on Istio

We have a kubernetes cluster with ~100 nodes with istio and want to enable the Locality LoadBalancing feature. This will save us up to 70k USD/year because our interzone data traffic is too high.

I’ve followed the docs and setup the istio configmap like this:

 ...
  meshNetworks: {}


  localityLbSetting:
    enabled: true
    distribute:
    - from: us-east-1/us-east-1a/*
      to:
        "us-east-1/us-east-1a/*": 100
    - from: us-east-1/us-east-1b/*
      to:
        "us-east-1/us-east-1b/*": 100
...

And then deployed 2 apps, one of them just responds with the zone where the node is deployed (we are using a VirtualService) and the another one just do the requests.

The requests that are coming from node in us-east-1a should only be replied by the nodes in the same zone, right?

We also tried to set this variable inside pilot pods:

PILOT_ENABLE_LOCALITY_LOAD_BALANCING

But it’s not happening.

When I get logs from one pod that is deployed in zone “us-east-1a” it shows replies from both zones.

Istio Version: 1.2.8

Kubernetes Version: 1.14

Any help is appreciated!
Thank you!

First question is if you set up a DestinationRule with OutlierDetection.

The docs do say: In order for Envoy to determine when instances are unhealthy, an Outlier Detection rule must be defined for each service. This also applies for the simple case of keeping the traffic local.

Hey, thank you!

Yes, I did.

spec:
  host: forward-awsapi.platform.svc.cluster.local
  trafficPolicy:
    connectionPool:
      http:
        http2MaxRequests: 1000
        maxRequestsPerConnection: 10
      tcp:
        maxConnections: 100
    outlierDetection:
      baseEjectionTime: 15m
      consecutiveErrors: 7
      interval: 5m

But have no effect. :confused:

Hi, @erickfaustino,
Have you resolve your problem, I also ran into the same one as yours.