Manage virtual services

更新时间:
复制 MD 格式

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 destinations. 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

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the target instance. Then, in the left-side navigation pane, choose Traffic Management Center > VirtualService.

    For more information about configuration examples and descriptions, see Virtual Service(Virtual Service)CRDdescription. You can use the following methods to create a virtual service:

    • Method 1: Click Create, configure the parameters, and then click Create.

    • Method 2: Click Create from YAML. Select a namespace from the Namespaces drop-down list and a template from the Scenario Template drop-down list. In the YAML code editor, modify the virtual service configuration as needed, and then click Create.

Related operations

After you create a virtual service, you can perform the following operations in the Operator column on the VirtualService page.

  • View or modify the YAML: Click View YAML next to the target virtual service. In the Edit dialog box, modify the configuration and click OK.

  • Manage versions: Click Version next to the target virtual service. In the Version dialog box, modify the information as needed, and then click Rollback.

  • Delete a virtual service: Click Delete next to the target virtual service. In the Confirm dialog box, click OK.

Important

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.