This topic describes how to switch all production traffic from a Container Service
for Swarm cluster to a Container Service for Kubernetes (ACK) cluster after you validate
the functions of the ACK cluster. You can switch traffic by modifying the DNS record
or updating the client configurations.
Prerequisites
To reduce the risk of service disruption, make sure that the services in the ACK cluster
are running as expected before you switch all production traffic to the cluster. You
can perform regression testing to verify the functions of the services by using the
test domain name or a production domain name. The production domain name must have
an Internet Content Provider (ICP) number. For more information, see Regression testing.
Switch traffic by modifying the DNS record
If your client connect to the services through a production domain name, you can modify
DNS records to switch production traffic to the ACK cluster without service disruption.
- Obtain the IP address of the default Server Load Balancer (SLB) instance attached
to the ACK cluster. The IP address is 39.XX.XX.112 in this example.
Log on to the
ACK console. In the left-side navigation pane, choose . On the Ingress page, select the
k8s-piggymetrics-cluster cluster and the
default namespace. The
endpoint of the SLB instance attached to the ACK cluster is
39.XX.XX.112.
- Add the IP address 39.XX.XX.112 as a backend IP address for the production domain name piggymetrics.com at your DNS provider.
- Monitor the service performance and check whether traffic sent to the ACK cluster
is properly handled. For more information, see Regression testing.
Note You can also use your own monitoring system to check whether services in the ACK cluster
are running as expected.
- After you make sure that traffic sent to the ACK cluster is properly handled, log
on to the platform of your DNS provider that hosts the production domain name. Remove
the IP address of the SLB instance attached to the Container Service for Swarm cluster
from the backend IP address list.
In this example, the IP address of the SLB instance attached to the Container Service
for Swarm cluster is 39.XX.XX.230. Remove the IP address from the backend IP address list for the production domain
name piggymetrics.com.
Switch traffic by updating the client configurations
The test domain name is related to the cluster ID. Therefore, the test domain name
of the Container Service for Swarm cluster is different from that of the ACK cluster.
The client may access the Container Service for Swarm cluster through the test domain
name or use the host IP to access the IP address of the SLB instance attached to the
cluster. In this case, you cannot switch traffic to the ACK cluster without service
disruption. We recommend that you perform the switchover during off-peak hours.
- Obtain the IP address of the SLB instance that is attached to the ACK cluster. The
IP address is 39.XX.XX.112 in this example.
Log on to the
ACK console. In the left-side navigation pane, choose . On the Ingress page, select the
k8s-piggymetrics-cluster cluster and the
default namespace. The
endpoint of the SLB instance attached to the ACK cluster is
39.XX.XX.112.
- Add 39.XX.XX.112 to the list of IP addresses that the client accesses by updating the configuration
or code of the client.
- Monitor the service performance and check whether traffic sent to the ACK cluster
is properly handled. For more information, see Regression testing.
Note You can also use your own monitoring system to check whether services in the ACK cluster
are running as expected.
- After you make sure that traffic sent to the ACK cluster is properly handled, remove
the IP address of the SLB instance attached to the Container Service for Swarm cluster
from the list of IP addresses that the client accesses. You can complete this task
by updating the configuration or code of the client.
In this example, the IP address of the SLB instance attached to the Container Service
for Swarm cluster is 39.XX.XX.230. Remove this IP address from the list of IP addresses that the client accesses.