This topic describes how to migrate workloads from a self-managed Kubernetes cluster to a Container Service for Kubernetes (ACK) cluster without service interruptions.
Migration scheme
Procedure
Create and configure an ACK cluster.
O&M engineers create an ACK cluster and configure the cluster resources. This simplifies application migration for developers. For more information, see Create an ACK managed cluster.
The following configuration items are required when you create the ACK cluster:
Cluster type: We recommend that you create an ACK Pro cluster. The control plane of an ACK Pro cluster is managed by ACK. You need to create and manage only worker nodes. You are charged only for the resources used by the worker nodes.
Operating system: Select an operating system based on your requirements.
By default, CentOS 7.6 or Aliyun Linux 2.1903 is selected. We recommend that you use the default settings.
If the default system kernel cannot meet your requirements, you can use a custom image. For more information, see Use a custom image to create an ACK cluster.
VPC: Select a virtual private cloud (VPC) and vSwitches for the ACK cluster.
SNAT: Configure SNAT entries for the VPC.
Public access: Expose the API server of the ACK cluster by using an elastic IP address (EIP).
CloudMonitor agent: Install the CloudMonitor agent on the Elastic Compute Service (ECS) instances in the ACK cluster.
Simple Log Service: Install and configure the Simple Log Service agent in the ACK cluster.
Migrate data.
Migrate databases.
Create an ApsaraDB RDS instance.
Configure a whitelist for the database to allow only specified IP addresses to access the ApsaraDB RDS instance.
Configure a PrivateZone.
Use the PrivateZone to resolve the domain name of the database to the IP address of the ApsaraDB RDS instance. This eliminates the need to modify the database configuration on applications.
Migrate the data in the MySQL database of the self-managed Kubernetes cluster.
Use Data Transmission Service (DTS) to migrate the data from the MySQL database to the ApsaraDB RDS instance in full, incremental, or two-way synchronization mode. For more information, see Migrate data from a self-managed MySQL database to an ApsaraDB RDS for MySQL instance.
Migrate data.
Activate Object Storage Service (OSS).
Create an OSS bucket.
Migrate the data that is stored in the self-managed Kubernetes cluster.
Use the ossimport tool to migrate the data in batches from an on-premises server or a third-party cloud storage service to OSS. For example, you can choose a third-party cloud storage service such as Amazon Simple Storage Service (S3), Microsoft Azure, or Tencent Cloud Object Storage. For more information, see Overview.
Migrate images.
Create a Container Registry repository.
Set the credential that is used to access the created Container Registry repository.
Migrate the images of the self-managed Kubernetes cluster.
You can use the image-syncer tool to migrate the images of the self-managed Kubernetes cluster to the Container Registry repository. For more information, see Use image-syncer to migrate container images.
Migrate application configurations.
O&M engineers or developers migrate the cluster or application configurations. For more information, see Migrate applications from an external Kubernetes cluster to ACK clusters.
Perform regression tests.
Test engineers perform regression tests on the ACK cluster without interrupting the online business.
Configure the domain names for regression tests.
Test applications.
Check the logged application events.
Check the monitoring metrics of the applications.
Switch all traffic to ACK.
O&M engineers modify the Domain Name System (DNS) configuration to switch traffic to the ACK cluster.
Use the DNS service: Modify the DNS configuration to switch the traffic.
Update the configurations or code of the client to switch the traffic.
Undeploy the self-managed Kubernetes cluster.
O&M engineers check whether the ACK cluster can be accessed as expected. Then, O&M engineers undeploy the self-managed Kubernetes cluster.
Check whether the ACK cluster can receive and send traffic as expected.
Undeploy the self-managed Kubernetes cluster.
Clear the backup files stored in the OSS bucket that is created when you migrate applications.