All Products
Search
Document Center

Alibaba Cloud Service Mesh:Verify the zone aware routing feature on the topology of an ASM instance

Last Updated:Jun 05, 2023

Service Mesh (ASM) allows you to view the topology of an application. This topic describes how to observe the effect of the zone aware routing feature on the topology of an ASM instance. The access to a Bookinfo application by using an ingress gateway is used as an example.

Prerequisites

  • An ASM instance is created. For more information, see Create an ASM instance.
  • An ACK managed cluster is created. For more information, see Create an ACK managed cluster.
  • The cluster is added to the ASM instance. For more information, see Add a cluster to an ASM instance.
  • Nodes in the ACK cluster reside in at least two zones. The cn-hangzhou-j and cn-hangzhou-k zones are used in this topic. You can view the region and zone where the ECS instance that corresponds to a cluster node resides in the ACK console. For more information, see Regions and zones.

  • An ingress gateway is deployed. The topology of the ASM instance can be viewed. For more information, see Get started.

  • A Helm 3 client is installed. For more information, see Helm.

Step 1: Deploy a sample application

  1. Download the Helm installation package that is used to deploy a sample application.

  2. Decompress the package and open the asm-az-routing directory in the folder obtained after decompression. Specify the zones where you want to deploy the application in the values.yaml file.

    In this example, the following zone settings are used:

    zone1: cn-hangzhou-j
    zone2: cn-hangzhou-k
  3. Run the following command to deploy a sample application:

    helm install --namespace azdemo azdemo ./
  4. When the application pod runs properly, run the following command to access the service by using the ingress gateway:

    while true; do
      curl -I http://{IP address of the ingress gateway}/productpage ;
      echo;sleep 1;
    done

Step 2: Log on to Mesh Topology and view the topology of the ASM instance

  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 ASM instance. In the left-side navigation pane, choose Observability Management Center > Mesh Topology.
  3. On the Mesh Topology page, click Copy token and open in new window.

  4. On the logon page of Mesh Topology, enter the token and click log in.

  5. Select the namespace of the ASM instance, select Traffic Distribution, Traffic Rate, and Traffic Animation from the Display drop-down list, and deselect Service Nodes.

    The following figure shows an example topology.Topology example 1

Step 3: Observe the topology to verify automatic route switching between zones

  1. Reduce the number of pods to zero for reviews-v1 that is deployed in the first zone. This way, the service becomes unavailable.

    1. Log on to the ACK console and click Clusters in the left-side navigation pane.

    2. On the Clusters page, click the name of a cluster and choose Workloads > Deployments in the left-side navigation pane.

    3. Find the deployment and click Scale in the Actions column, set Desired Number of Pods to 0, and then click OK.

  2. Go back to the topology page that you logged on to in Step 2: Log on to Mesh Topology and view the topology of the ASM instance.

    The following figure shows an example topology.Topology example 2The topology shows that productpage v1 points to reviews-v2. This change indicates that when the reviews service in the same zone becomes unavailable, the request is automatically routed to the reviews service in another zone.

Step 4: Observe the topology to verify the zone aware routing feature

  1. Increase the number of pods to one for reviews-v1 that is deployed in the first zone. This way, the service becomes available.

    1. Log on to the ACK console and click Clusters in the left-side navigation pane.

    2. On the Clusters page, click the name of a cluster and choose Workloads > Deployments in the left-side navigation pane.

    3. Find the deployment and click Scale in the Actions column, set Desired Number of Pods to 1, and then click OK.

  2. Go back to the topology page that you logged on to in Step 2: Log on to Mesh Topology and view the topology of the ASM instance.

    The following figure shows an example topology.Topology example 3The topology shows that productpage v1 points to reviews-v1 that is deployed in the same zone. The result indicates that the zone aware routing feature takes effect.