All Products
Search
Document Center

Alibaba Cloud Service Mesh:Retain the CLB instance when deleting an ASM ingress gateway

Last Updated:Mar 11, 2026

When you delete a Service Mesh (ASM) ingress gateway, the associated Classic Load Balancer (CLB) instance is also deleted if it was auto-created with the gateway. To retain the CLB instance, you can reassociate it as an existing instance before deletion.

Why the CLB instance is deleted

ASM handles CLB instances differently depending on how the ingress gateway was originally created:

  • Create a CLB Instance was selected: ASM auto-created a CLB instance for the gateway. Deleting the gateway also deletes this CLB instance.

  • Use Existing CLB Instance was selected: The CLB instance is independent. Deleting the gateway does not affect the CLB instance.

Solution

To retain an auto-created CLB instance, add its instance ID as a Kubernetes service annotation in the gateway YAML. This changes the CLB instance from auto-managed to externally referenced, so ASM no longer deletes it with the gateway.

Step 1: Get the ingress gateway IP address

  1. Log on to the ASM console.

  2. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  3. Click the name of the target ASM instance. In the left-side navigation pane, choose ASM Gateways > Ingress Gateway.

  4. On the Ingress Gateway page, note the IP address of the ingress gateway whose CLB instance you want to retain.

Get the ingress gateway IP address

Step 2: Get the CLB instance ID

  1. Log on to the CLB console.

  2. In the left-side navigation pane, choose CLB > Instances.

  3. On the Instances page, search for the IP address from Step 1. Note the CLB instance ID from the search results.

Get the CLB instance ID

Step 3: Add the CLB instance ID to the gateway YAML

  1. On the Ingress Gateway page, find the target ingress gateway and click YAML.

  2. In the YAML editor, add the following annotation under serviceAnnotations. Replace <your-clb-instance-id> with the CLB instance ID from Step 2.

       service.beta.kubernetes.io/alibaba-cloud-loadbalancer-id: <your-clb-instance-id>
  3. Click OK.

Add CLB instance ID annotation in YAML

After you save the YAML, ASM automatically redeploys the ingress gateway. The gateway status changes to Creating and then back to Running when redeployment completes.

Ingress gateway redeployment status

Step 4: Delete the ingress gateway and verify CLB retention

  1. On the Ingress Gateway page, find the target ingress gateway and click Delete. In the Submit dialog, click OK.

  2. Log on to the CLB console. On the Instances page, search for the IP address from Step 1.

If the CLB instance still appears in the search results, the instance was retained successfully.

CLB instance retained after gateway deletion