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 for converting Swarm compose files to Kubernetes resource
files. We have 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 for converting Swarm compose files to Kubernetes resource files.
We have 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, choose . On the Clusters page, find the cluster that you want to manage and click Manage 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
succeeds 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.