This topic describes how to migrate traffic from a self-managed Istio ingress gateway to an ASM ingress gateway.
Traffic flow of the migration solution

Step 1: Create an ingress gateway for the ASM instance.
For more information, see Deploy an ingress gateway service.
When you create an ASM ingress gateway, take note of the following points:
The name of the ASM ingress gateway must be different from the existing Istio ingress gateway. You can add the -asm suffix to the name of the ASM ingress gateway to distinguish the ASM ingress gateway from the existing Istio ingress gateway. For example, you can name the ASM ingress gateway ingressgateway-asm.
In Step 5 of the Deploy an ingress gateway service topic, set the Cluster parameter to the Kubernetes cluster where the source Istio ingress gateway resides.
Change the Domain Name System (DNS) record of the domain name to the IP address of the ASM ingress gateway. If you cannot change the DNS record of the domain name, you can gradually migrate the traffic by adjusting the weights of source and target ingress gateways. In this case, the ASM ingress gateway must reuse the Server Load Balancer (SLB) instance that is associated with the source Istio ingress gateway. In the preceding figure, the ASM ingress gateway reuses the SLB instance that is associated with the source Istio ingress gateway.
NoteSLB instances that are created by using the LoadBalancer service type cannot be reused.
Step 2: Migrate configurations.
Change the value of selector.istio to the name of your ASM ingress gateway in the YAML file to migrate ingress gateway configurations. Sample YAML file:
spec: selector: istio: ingressgateway-asm
Migrate other configurations such as VirtualService and DestinationRule configurations.
Step 3: Migrate traffic.
Modify the service annotations to adjust the weights of source and target ingress gateways. You can first set the weight of the ASM ingress gateway to a small value, such as 10, and check whether the traffic flow meets expectations. Then, gradually increase the weight until all the traffic is routed to the ASM ingress gateway.
Methods of adjusting the weight:
To adjust the weight of the source Istio ingress gateway, edit the
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-weight
annotation for the corresponding service.To adjust the weight of the ASM ingress gateway, edit the
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-weight
service annotation for the ASM ingress gateway.