Updated on 2025-04-25 GMT+08:00

Creating a Traffic Policy

Creating a Traffic Policy Using YAML

To create a traffic policy using YAML, perform the following steps:

  1. Log in to the UCS console. In the navigation pane, choose Service Meshes.
  2. Click the name of the target service mesh to go to its details page.
  3. In the navigation pane, choose Traffic Governance > Traffic Policy.
  4. Click Create from YAML in the upper right corner.
  5. Select YAML for Current Data and edit the configuration in the editing area. (Configure the parameters based on site requirements.)

    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: forecast
      namespace: weather
    spec:
      host: forecast
      subsets:
      - name: v2
        labels:
          version: v2
        trafficPolicy:
          loadBalancer:
            simple: ROUND_ROBIN
      - name: v1
        labels:
          version: v1

  6. Click OK.