Istio locality traffic distribution

Hey Guys,

ip-10-0-111-252.ec2.internal → us-east-1a
ip-10-0-120-0.ec2.internal → us-east-1b
ip-10-0-130-200.ec2.internal → us-east-1e
ip-10-0-149-80.ec2.internal → us-east-1d

(base) root@ubuntu:/home/outlier# kubectl get po -o wide -n istio-system 
NAME                                            READY   STATUS    RESTARTS   AGE   IP             NODE                           NOMINATED NODE   READINESS GATES
istio-egressgateway-85c567665-8c49d             1/1     Running   0          23h   10.0.138.81    ip-10-0-130-200.ec2.internal   <none>           <none>
istio-ingressgateway-669cfc876b-b4wg8           1/1     Running   0          23h   10.0.108.90    ip-10-0-111-252.ec2.internal   <none>           <none>
istio-ingressgateway-669cfc876b-bs879           1/1     Running   0          24m   10.0.142.209   ip-10-0-130-200.ec2.internal   <none>           <none>
(base) root@ubuntu:/home/outlier# kubectl get po -o wide
NAME                                 READY   STATUS    RESTARTS   AGE   IP             NODE                           NOMINATED NODE   READINESS GATES
fortio-deploy-6dc9b4d7d9-lxq5w       2/2     Running   0          18h   10.0.137.140   ip-10-0-130-200.ec2.internal   <none>           <none>
recommendation-v2-57ddf9cd95-688tr   2/2     Running   0          44m   10.0.99.243    ip-10-0-111-252.ec2.internal   <none>           <none>
recommendation-v2-57ddf9cd95-968xj   2/2     Running   0          44m   10.0.157.238   ip-10-0-149-80.ec2.internal    <none>           <none>
recommendation-v2-57ddf9cd95-pl2sv   2/2     Running   0          44m   10.0.120.166   ip-10-0-120-0.ec2.internal     <none>           <none>
recommendation-v2-57ddf9cd95-x465z   2/2     Running   0          44m   10.0.135.67    ip-10-0-130-200.ec2.internal   <none>           <none>

So I have two ingress-gateway pods reside in us-east-1a and us-east-1d, and I have 5 pods in each az. What I’m trying to do is distribute all the traffic from us-east-1a to us-east 1b , all the traffic from us-east-1e to us-east-1d.

---

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: recomm-dr
spec:
  host: recommendation
  trafficPolicy:
    outlierDetection:
      baseEjectionTime: 1m
      consecutiveErrors: 1
      interval: 1s
      maxEjectionPercent: 50
      minHealthPercent: 50
#    connectionPool:
#      http:
#        http1MaxPendingRequests: 1
#        maxRequestsPerConnection: 1
    loadBalancer:
      localityLbSetting:
        enabled: true
        distribute:
        - from: us-east-1/us-east-1a/*
          to:
#            "us-east-1a": 1 
            "us-east-1/us-east-1b/*": 100
#        - from: us-east-1e
#          to:
#            "us-east-1d": 100
  subsets:
  - name: v2
    labels:
      version: v2                                                     

The expected behavior should be I got all the response from recommendation-v2-57ddf9cd95-968xj and recommendation-v2-57ddf9cd95-pl2sv. But the result only contain the other ones

(base) root@ubuntu:/home/outlier# kubectl exec -it $CLIENT_POD  -c istio-proxy  -- sh -c 'while true; do curl http://httpbin.pogospike.com/; sleep 1; done'
recommendation v2 from 'recommendation-v2-57ddf9cd95-x465z': 111
recommendation v2 from 'recommendation-v2-57ddf9cd95-688tr': 97
recommendation v2 from 'recommendation-v2-57ddf9cd95-688tr': 98
recommendation v2 from 'recommendation-v2-57ddf9cd95-x465z': 112
recommendation v2 from 'recommendation-v2-57ddf9cd95-688tr': 99
recommendation v2 from 'recommendation-v2-57ddf9cd95-x465z': 113

Any ideas ?
Thanks in advance :smiley:

I am facing the similar issue, after i enabled multi cluster across region.
Few of the pods are getting almost double traffic then rest.

Did you find any workaround?