Virtual services are critical resources of Service Mesh (ASM) instances for traffic routing. A virtual service defines a set of rules for routing traffic to destionations. Each routing rule defines traffic matching criteria. If traffic matches the criteria in a routing rule, traffic is forwarded to the destination service or a version (subset) of the destination service specified in the routing rule. This topic describes how to create, modify, and delete a virtual service.
Create a virtual service
Log on to the ASM console. In the left-side navigation pane, choose .
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
For more information about configuration examples and descriptions, see Virtual Service. You can use the following methods to create a virtual service:
Method 1: Click Create. On the Create page, configure the parameters, and then click Create.
Method 2: Click Create from YAML. On the Create page, select a namespace from the Namespace drop-down list and a template from the Template drop-down list. In the YAML code editor, modify the configurations of the virtual service as needed and click Create.
Related operations
After a virtual service is created, you can perform the following operations on the virtual service in the Actions column on the VirtualService page:
View or modify the YAML file of the virtual service: Find the desired virtual service and click YAML in the Actions column. In the Edit dialog box, modify the configurations as needed and click OK.
Modify the version of the virtual service: Find the desired virtual service and click Version in the Actions column. In the Version dialog box, modify the configurations as needed and click Rollback.
Delete the virtual service: Find the desired virtual service and click Delete in the Actions column. In the Submit message, click OK.
After you delete a virtual service, the routing of requests and traffic distribution are affected, and unexpected issues may occur. Exercise caution when you delete a virtual service.