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

  1. 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.

    Installation: Download the latest executable file AliyunContainerService/kompose/releases from GitHub based on your operating system.
    kompose-linux-amd64
    kompose
  2. Set up the environment for kubectl.
    1. Download the latest kubectl client from the Kubernetes change log page.
    2. Install and set up the kubectl client. For more information, see Install and set up kubectl.
    3. Configure cluster credentials.
      1. Log on to the Container Service for Kubernetes (ACK) console. In the left-side navigation pane, choose Clusters > Clusters. On the Clusters page, find the cluster that you want to manage and click Manage in the Actions column.
      2. On the Basic Information tab, copy and paste the KubeConfig content to $HOME/.kube/config on your on-premises machine.
    4. 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.Environment is set up