Before you migrate application configurations from a Swarm cluster to a Kubernetes
cluster, you must set up the environment for migration. This topic describes how to
set up the environment for migration.
Background information
Kompose is an open source tool that is used to convert Swarm compose files into Kubernetes
resource files. Alibaba Cloud has optimized Kompose to support labels that are specific
to Alibaba Cloud.
After Kubernetes resource files are generated, you can Use kubectl to connect to an ACK cluster and deploy these files in a Kubernetes cluster.
Kompose and kubectl are required to migrate application configurations. We recommend
that you install Kompose and kubectl on a dedicated Elastic Compute Service (ECS)
instance.
Procedure
- Install Kompose.
Kompose is a tool that is used to convert Swarm compose files into Kubernetes resource
files. Alibaba Cloud has optimized Kompose to support labels that are specific to
Alibaba Cloud. For more information about Kompose, see AliyunContainerService/kompose.
- Set up the environment for kubectl.
- Download the latest kubectl client from the Kubernetes change log page.
- Install and set up the kubectl client. For more information, see Install and set up kubectl.
- Configure cluster credentials.
- Log on to the Container Service for Kubernetes (ACK) console.
- In the left-side navigation pane, click Clusters.
- On the Clusters page, find the cluster that you want to manage and click the name or click Details in the Actions column.
- On the Basic Information tab, copy and paste the KubeConfig content to $HOME/.kube/config on your on-premises machine.
- After the setup is complete, run the following commands to check whether the installation
is successful and cluster credentials are correctly configured.
kubectl version
kubectl cluster-info
Result
If the output is as shown in the following red box, it indicates that kubectl is installed
and the migration environment is set up.