Service Mesh (ASM) supports graphical user interface (GUI) for gateways. You can create destination rules and virtual services for an ASM gateway on a GUI without writing YAML files. This simplifies traffic management. This topic describes how to create traffic policies and routing rules for an ASM gateway on a GUI.
Prerequisites
Automatic sidecar proxy injection is enabled for the specified namespaces. For more information, see Enable automatic sidecar proxy injection.
An ingress gateway is deployed. For more information, see Create an ingress gateway.
An application is deployed in the cluster that is added to the ASM instance. For more information, see Deploy an application in an ACK cluster that is added to an ASM instance.
The IP address of the specified ASM gateway is obtained. For more information, see substep 1 of Step 3 in the Use Istio resources to route traffic to different versions of a service topic.
Example
You can create a traffic policy that specifies the load balancing and connection pool settings for a service on a GUI. In this example, the reviews service is used. After the traffic policy is created, a YAML file for a destination rule is automatically generated. You can create routing rules for a service to match specific content in a URL, such as /productpage and /login. In this example, the Bookinfo service is used. This way, you can access the Bookinfo service by using a URL that contains information such as /productpage.
Create a domain name
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 .
On the Ingress Gateway page, click the name of the target ASM gateway. In the left-side navigation pane of Gateway overview page, click Domain/Certificate.
On the Add Domain page, configure the following parameters, and click Create.
Parameter
Example
Domain
*
Protocol
HTTP
Namespace
default
Port Name
http
Port
80

Import an upstream service
Import an reviews service to an ASM gateway to associate the ASM gateway with the reviews service.
On the Ingress Gateway page, click the name of the ASM gateway to which you want to import the reviews service. In the left-side navigation pane of the Gateway overview page, click Upstream Service.
On the Gateway upstream services page, click Import service. On the Import service page, select a namespace from the Namespace drop-down list. In the select service box, select reviews and productpage, click the icon
to move the service to the selected box. Then, click Submit.
Create a traffic policy
Manage versions of the reviews service.
Group instances of the reviews service by version. In this example, the versions of the reviews service are v1, v2, and v3.
On the Gateway upstream services page, find the reviews service and click versions in the Actions column.
On the Versions page, click Add Service Version (Subnet). Set the Name parameter to v1. Then, click Add Label and set the Key parameter to version and Value parameter to v1.
Click Add Service Version (Subnet) again. Set the Name parameter to v2. Then, click Add Label and set the Key parameter to version and the Value parameter to v2.
Click Add Service Version (Subnet) again. Set the Name parameter to v3. Then, click Add Label and set the Key parameter to version and the Value parameter to v3. Then, click Create.
Create a traffic policy.
On the Gateway upstream services page, find the reviews service and click Traffic Policy in the Actions column.
On the Traffic Policy page, click Add Policy. Select Subset Level and select v3 from the Subset drop-down list. Turn on Load Balancing and select Simple. Then, set the Mode parameter to Random and click Submit.

(Optional) After the traffic policy is created, view the YAML file that is automatically generated for a destination rule.
On the Gateway upstream services page, find the reviews service and click YAML in the Actions column to view the YAML file in the Preview dialog box. After you confirm the correctness of the YAML file, click Submit.
NoteYou can also choose in the left-side navigation pane on the details page of the ASM instance. On the DestinationRule page, find the rule whose YAML file you want to view and click YAML in the Actions column. In the Edit dialog box, view the YAML file of the destination rule.
Create routing rules
Create routing rules.
Create a routing rule to match a URL that contains
/productpage.In the left-side navigation pane of the Gateway overview page, click Route management. On the page that appears, click Create.
In the set route detail step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Route type
The type of the traffic to be routed. In this example, the value is http.
Namespace
The namespace in which you create the routing rule. In this example, the value is default.
Name
The name of the routing rule. In this example, the value is
productpage-route.Description
The description of the routing rule. In this example, the value is
productpage routing.Priority
In this example, the value is
3.NoteThe priority of the routing rule. A smaller value indicates a higher priority. If a URL matches multiple routing rules, the routing rule that has the highest priority takes precedence.
Matching Rule
The content to be matched in a URL. Only requests with a URL that contains the specified content can be routed to the destination service.
Turn on Matching request URI, set Method to Exact and Content to
/productpage.NoteYou can also click Add Header Matching Rule to configure settings for matching HTTP headers.
In the set route destination step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Select upstream service
The service to which the routing rule applies. In this example, the value is productpage.
Port
(Optional) The port through which the routing rule connects to the upstream service. The upstream service may expose multiple ports. In this case, specify a port. This parameter can be left empty.
Subnet
The version of the service to which the routing rule applies. This parameter can be left empty.
Weight
The traffic weight of the destination service. This parameter can be left empty.
In the Advanced Settings step, turn on Fault Injection. After that, turn on Request Latency, set the Latency parameter to 4s and the Injection Percentage parameter to 100, and then click Create.
Create a routing rule to match a URL that contains
/static.On the Route management page, click Create.
In the set route detail step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Route Type
The type of the traffic to be routed. In this example, the value is http.
Namespace
The namespace in which you create the routing rule. In this example, the value is default.
Name
The name of the routing rule. In this example, the value is
static.Description
The description of the routing rule. In this example, the value is
static resource.Priority
The priority of the routing rule. In this example, the value is
0.Matching Rule
The content to be matched in a URL. Only requests with a URL that contains the specified content can be routed to the destination service.
Turn on Matching request URI, set Method to Prefix and Content to
/static.The subsequent steps for creating a routing rule to match a URL that contains
/staticare the same as those for creating a routing rule to match a URL that contains/productpage.
Create a routing rule to match a URL that contains
/login.On the Route management page, click Create.
In the set route detail step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Route Type
The type of the traffic to be routed. In this example, the value is http.
Namespace
The namespace in which you create the routing rule. In this example, the value is default.
Name
The name of the routing rule. In this example, the value is
login.Description
The description of the routing rule. In this example, the value is
login request routing.Priority
The priority of the routing rule. In this example, the value is
0.Matching Rule
The content to be matched in a URL. Only requests with a URL that contains the specified content can be routed to the destination service.
Turn on Matching request URI and set the Method parameter to Prefix and the Content parameter to
/login.The subsequent steps for creating a routing rule to match a URL that contains
/loginare the same as those for creating a routing rule to match a URL that contains/productpage.
Create a routing rule to match a URL that contains
/logout.On the Route management page, click Create.
In the set route detail step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Route Type
The type of the traffic to be routed. In this example, the value is http.
Namespace
The namespace in which you create the routing rule. In this example, the value is default.
Name
The name of the routing rule. In this example, the value is logout.
Description
The description of the routing rule. In this example, the value is logout route.
Priority
The priority of the routing rule. In this example, the value is
0.Matching Rule
The content to be matched in a URL. Only requests with a URL that contains the specified content can be routed to the destination service.
Turn on Matching request URI and set the Method parameter to Prefix and the Content parameter to /logout.
The subsequent steps for creating a routing rule to match a URL that contains /logout are the same as those for creating a routing rule to match a URL that contains /productpage.
Create a routing rule to match a URL that contains
/api/v1/products.On the Route management page, click Create.
In the set route detail step, set the parameters that are described in the following table, and then click Next.
Parameter
Description
Route Type
The type of the traffic to be routed. In this example, the value is http.
Namespace
The namespace in which you create the routing rule. In this example, the value is default.
Name
The name of the routing rule. In this example, the value is
products-route.Description
The description of the routing rule. In this example, the value is
product information.Priority
The priority of the routing rule. In this example, the value is
0.Matching Rule
The content to be matched in a URL. Only requests with a URL that contains the specified content can be routed to the destination service.
Turn on Matching request URI, set Method to Prefix and Content to
/api/v1/products.The subsequent steps for creating a routing rule to match a URL that contains
/api/v1/productsare the same as those for creating a routing rule to match a URL that contains/productpage.
Check whether the routing rules take effect.
In the address bar of Google Chrome, enter
http://{IP address of the ASM gateway}/productpage.The following figure shows an example on the page that appears.

In the upper-right corner of the Bookinfo page, click Sign in.
On the Please sign in page, enter your account and password and click Sign in.
The following figure shows the page of the Bookinfo service after logon.

You can also use a URL that contains /logout, /static, or /api/v1/productsto access the Bookinfo service for verification.
In the upper-right corner of Google Chrome, click the
icon and choose More tools > Developer tools. Click the Network tab.Refresh the page.
On the Network tab, a delay of about 4 seconds is reported.

(Optional) After the routing rules are created, view the YAML files that are automatically generated for the corresponding virtual services.
On the details page of the ASM instance, choose in the left-side navigation pane.
On the VirtualService page, find the virtual service that you want to manage and click YAML in the Actions column.
In the Edit dialog box, view the YAML file of the virtual service. Confirm the settings and click OK.
Related operations
View service details
View the details of an imported service, such as the settings of the sidecar proxy injection and the region.
On the Ingress Gateway page, click the name of the ASM gateway for which you want to view service details. In the left-side navigation pane of the Gateway overview page, click Upstream Service.
On the Gateway upstream services page, find the service whose details you want to view and click Service Details in Actions column. On the Service Details page, view the details of the service, such as the settings of the sidecar proxy injection and the region.
Disable a routing rule
You can disable a routing rule so that this routing rule no longer takes effect.
On the Ingress Gateway page, click the name of the ASM gateway for which you want to disable a routing rule.
In the left-side navigation pane of the Gateway overview page, click Route management.
On the Route Management page, find the desired routing rule and click Offline in the Actions column.
In the Submit message, click OK.
Verify that the disabled routing rule no longer takes effect.
In the address bar of Google Chrome, enter
http://{IP address of the ingress gateway}/productpage.In the upper-right corner of the Bookinfo page, click Sign in.
On the Please sign in page, enter your account and password and click Sign in.
A 404 error occurs, which indicates that the login routing rule is disabled and no longer takes effect.
You can enable a disabled routing rule by performing the following steps:
On the Route management page, find the routing rule that you want to enable and click Online in the Actions column. In the Submit message, click OK.