When you delete an Alibaba Cloud Service Mesh (ASM) gateway, the Server Load Balancer (SLB) instance configured for the ASM gateway is also deleted. This topic describes the cause of the issue and provides a solution.

Problem description

When you delete an ASM gateway, the SLB instance configured for the ASM gateway is also deleted.

Cause

When you create an ASM gateway, if you specify Create SLB Instance, an SLB instance is automatically created. In this case, when you delete the ASM gateway, the SLB instance that is automatically created is also deleted.
Note If you specify Use Existing SLB Instance when you create an ASM gateway, the SLB instance that you use is retained after you delete the ASM gateway.
Create SLB Instance

Solution

To ensure that the SLB instance that is automatically created for an ASM gateway is retained when you delete the ASM gateway, perform the following steps:

  1. Obtain the IP address of the ASM gateway.
    1. Log on to the ASM console.
    2. In the left-side navigation pane, choose Service Mesh > Mesh Management.
    3. On the Mesh Management page, find the ASM instance that you want to configure. Click the name of the ASM instance or click Manage in the Actions column.
    4. On the details page of the ASM instance, click ASM Gateways in the left-side navigation pane.
    5. On the ASM Gateways page, obtain the IP address of the ASM gateway whose SLB instance you want to retain in the Kubernetes Service column. obtain the IP address
  2. Obtain the ID of the SLB instance.
    1. Log on to the SLB console.
    2. In the left-side navigation pane, choose CLB (FKA SLB) > Instances.
    3. On the Instances page, enter the ID of the ASM gateway obtained in Step 1 in the search box. In the search results, you can obtain the ID of the SLB instance. obtain the ID of the SLB instance
  3. Modify the YAML file of the ASM gateway.
    1. On the ASM Gateways page, click YAML in the Actions column of the ASM gateway that you want to manage.
    2. Add the following content to the serviceAnnotations parameter in the YAML file. Then, click OK.
      Replace {YourSLBId} with the ID of the SLB instance obtained in Step 2.
      service.beta.kubernetes.io/alibaba-cloud-loadbalancer-id: {YourSLBId}
      YAMLAfter you modify the YAML file, the system automatically redeploys the ASM gateway. The ASM gateway enters the Creating state. If the status of the ASM gateway becomes Running, the ASM gateway is redeployed.running
  4. Delete the ASM gateway and check whether the SLB instance that is automatically created for the ASM gateway is also deleted.
    1. On the ASM Gateways page, find the AMS gateway that you want to delete and click Delete in the Actions column. In the message that appears, click OK.
    2. Log on to the SLB console. On the Instances page, enter the ID of the ASM gateway obtained in Step 1 in the search box.
      If the SLB instance is displayed in the search results on the Instances page, the settings in Step 2 take effect. The following figure shows an example. Instances