Managing Traffic of Multiple Clusters
UCS intelligently distributes application requests across clouds and regions and supports functions such as traffic splitting, grayscale releases, and failovers.
Prerequisites
- You have added an existing cluster to the fleet and connect the cluster to UCS. For details, see Step 3: Add Clusters to the Fleet.
- A Service of the LoadBalancer type has been created for application instances in the cluster.
- A DNS record set has been configured for your public domain name. For details, see (Optional) Configuring a DNS Record Set.
Procedure
Assume that your application is deployed in multiple regions. Users in Chinese Mainland access the application in CN North-Beijing4, while users in Asia Pacific will be served in AP-Singapore to reduce the latency. In this case, you can create a traffic policy to split traffic for the application by region.
- Log in to the UCS console.
- In the navigation pane, choose Traffic Distribution.
- In the upper right corner, click Create Traffic Policy.
- Select the domain name added to the record set and enter the domain name prefix as prompted. If there is no subdomain name, the domain name prefix can be left blank.
- Add a scheduling policy. In this example, only key parameters listed in Table 1 are configured. Retain the default values for other parameters. To create traffic policies for users in different regions, repeat this step and select different clusters and line types.
Table 1 Key parameters of a scheduling policy Parameter
Description
Cluster
Select a cluster in the Running state. All clusters taken over by UCS are displayed.
Namespace
Select the namespace that the Service belongs to. The default value is Default.
Service
Select a Service. Only Services of the LoadBalancer type can be selected. The available Services will be displayed.
Line Type
- ISP line: routes visitors to the optimal address based on the carrier networks they use. The default value is 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 default value is Chinese Mainland/Default regions. You can select any region. For Chinese Mainland, the region granularity is province. For Abroad, the region granularity is country/region.
Figure 1 Adding a scheduling policy
- Click OK. Under this traffic policy, users in Asia Pacific will preferentially access the specified line.
- Check whether the scheduling policy takes effect. For details, see How Do I Check Whether a Record Set Has Taken Effect?
You can use a device that has connected to the Internet in Asia Pacific and run the following command to check whether the scheduling policy takes effect:
nslookup demo.***.com
If the device OS does not support the nslookup command, manually install it first. For example, if you are using a CentOS device, run the yum install bind-utils command first.
If the following information is displayed and Address is the IP address of the load balancer for the target cluster, the scheduling policy takes effect.
Server: *** Address: *.*.*.* Non-authoritative answer: Name: demo.***.com Address: 124.*.*.*
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot