Multicloud network traffic distribution configuration under the mesh¶
This page describes how to configure different traffic flows for workloads in a multicloud network.
Preconditions:
- The service helloworld runs under the namespace helloworld of the mesh hosted-mesh
- Enable Multicloud Network Interconnection
- Mesh provides ingressgatway gateway instance
Configuration steps:
-
Based on the cluster to which it belongs, the request traffic is divided by weight;
-
Label the helloworld workload of both clusters:
Belonging cluster Label Value yl-cluster10 version v1 yl-cluster20 version v2 -
Click Mesh Sidecar -> Workload in the left navigation bar to inject the sidecar into the helloworld workload of the two clusters.
-
On the left navigation bar, click Traffic Management -> Destination Rules -> Create to create two service versions.
The corresponding YAML is as follows:
-
On the left navigation bar, click Traffic Management -> Gateways -> Create to create a gateway rule.
The corresponding YAML is as follows:
-
On the left navigation bar, click Traffic Management -> Virtual Service -> Create , create routing rules, and divide traffic to two clusters based on the weight ratio:
The corresponding YAML is as follows:
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: helloworld-version namespace: helloworld spec: gateways: - helloworld-gateway hosts: - helloworld.helloworld.svc.cluster.local http: - match: - uri: exact: /hello name: helloworld-routes route: -destination: host: helloworld port: number: 5000 subset: v1 weight: 30 -destination: host: helloworld port: number: 5000 subset: v2 weight: 70
-
On the left navigation bar, click Mesh Configuration -> Multicloud Network Interconnection to enable Multicloud Network Interconnection.
-
Initiate 1000 get requests through JMeter and set the assertion
-
View the request aggregation report (set the assertion helloworld v2), the success rate is 70%, and the exception rate is close to 30%.