Hello, In Istio Multi-Primary setup, if you have the same app deployed in both the clusters [with same service name & same no: of replicas] traffic from cluster1 get’s equally distributed to pods in both the clusters. Is there a way to specify a weight for the traffic split across clusters, so that instead of 50:50 split I can specify x% of traffic from the cluster1 needs to be routed to cluster2 pods & vice versa?
Hi, I had the same problem as you. I try to split the traffic by using the weight parameters on the virtual service manifest but it doesn’t work. Because the istio is doesn’t recognize the workload label on the second cluster.
However this option will be available in Istio version 1.11.2 only.
Should be 1.11.1 as it have been in release-1.11 branch now
在 2021-08-24 18:59:03，“Soji Antony via Discuss Istio” email@example.com 写道：
It is not injected to the pod by sidecar-injector. It is internally in istio.
Hi @hzxuzhonghu I am having some trouble to get this working. Listing down the steps below which I followed for better clarity.
- Created multiprimary setup following Istio / Install Multi-Primary
> $ cat cluster1.yaml > apiVersion: install.istio.io/v1alpha1 > kind: IstioOperator > metadata: > namespace: istio-system > name: cluster1-istiocontrolplane > spec: > profile: default > values: > global: > meshID: mesh1 > multiCluster: > clusterName: cluster1 > network: network1 > $ cat cluster2.yaml > apiVersion: install.istio.io/v1alpha1 > kind: IstioOperator > metadata: > namespace: istio-system > name: cluster2-istiocontrolplane > spec: > profile: default > values: > global: > meshID: mesh1 > multiCluster: > clusterName: cluster2 > network: network1
- I have a test application v1 running in cluster1 & v2 running in cluster2 under ‘sample’ namespace [svc: testapp.sample.svc.cluster.local]
- Created a DestinationRule
$ cat destinationrule.yaml apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: testapp spec: host: testapp trafficPolicy: loadBalancer: simple: LEAST_CONN subsets: - name: network1 labels: topology.istio.io/cluster: cluster1 - name: kubernetes labels: topology.istio.io/cluster: cluster2
- Created a VirtualService with traffic split
$ cat virtualservice.yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: testapp spec: hosts: - testapp.sample.svc.cluster.local http: - route: - destination: host: testapp.sample.svc.cluster.local subset: network1 weight: 100 - destination: host: testapp.sample.svc.cluster.local subset: network2 weight: 0
My assumption was now all the traffic will go to cluster1 Pods. But this doesn’t seems to be working. Is this the correct method or am I missing something?
Hello, I’d really appreciate it if someone could shed some light upon this problem.