Updated on 2024-02-01 GMT+08:00

Creating a Traffic Policy

  1. Log in to the UCS console. In the navigation pane, choose Traffic Distribution.
  2. On the Traffic Distribution page, click Create Traffic Policy.
  3. On the page displayed, as shown in Figure 1, enter the domain name and add at least one scheduling policy. To create traffic policies for multiple domain names, repeat 3 to 5.

    • Domain name: The domain name prefix can be customized. The suffix is the public zone that has been licensed and has created a Huawei Cloud DNS record set.
      The prefix consists of multiple strings separated by periods (.) and only allows letters, digits, and hyphens (-). Do not start or end with a hyphen (-). The maximum characters of a string are 63, and the maximum total characters of a domain name is 254.
      • If there is no subdomain name, leave the domain name prefix blank.
      • The domain name suffix is the public zone that has been resolved in DNS. You can manage domain names on the DNS console. For details, see Public Zone Management.
    • Scheduling Policy: Traffic can be scheduled based on user locations and service policies. For details, see 4.
    Figure 1 Creating a traffic policy

  4. Click to add a scheduling policy and click OK, as shown in Figure 2. To add different scheduling policies for the same domain name, repeat this step. You can also add more scheduling policies later.

    • Cluster: Select a cluster in Running state. All clusters taken over by UCS are displayed.
    • Namespace: namespace that the Service belongs to. The default value is default.
    • Service: Select a Service. Only LoadBalancer Services can be selected.
    • Line Type:
      • Default: (mandatory) returns the default resolution result if no line is matched.
      • ISP line: routes visitors to the optimal address based on the carrier networks they use. Defaults to China Telecom/Default regions. You can specify a carrier and region down to province.
      • Region line: routes visitors to the optimal address based on their geographic locations. The value defaults to Chinese Mainland/Default regions. You can select a global region. For Chinese Mainland, the region granularity is province. For Global, the region granularity is country/region.

      You need to create a Default scheduling policy as the default resolution, and then add a custom scheduling policy. If no default line record set is added for the domain name, access to regions beyond the specified line will fail.

    • TTL: specifies cache duration of the record set on a local DNS server. The default value is 300s/5 minutes. If your service address changes frequently, set TTL to a smaller value.
    • Weight: If a resolution line in a domain name contains multiple record sets of the same type, you can set different weights to each record set. For details, see Configuring Weighted Routing.
    Figure 2 Adding a scheduling policy

  5. Click Create. The traffic policy is successfully created.

    Figure 3 Creating a traffic policy successfully