Procedure

  1. Use Kompose to convert a Swarm Compose file.
    Preprocess the Swarm Compose file and run the following command to convert the file by using Kompose:
    kompose-linux-amd64 convert -f source/swarm-piggymetrics.yaml --volumes PersistentVolumeClaimOrHostPath
    Note If the conversion is successful, Kubernetes resource files are generated. Warnings appear for the keys that cannot be automatically converted. Process these keys in any of the following ways:
    • Modify the Swarm Compose file and use Kompose to convert the file again.
    • Modify the generated Kubernetes resource files.
    • Ignore the warnings. Deploy the generated Kubernetes resource files. Then, log on to the Container Service - Kubernetes console and manually migrate these keys.
  2. Modify the Swarm Compose file.
    Kompose can convert most Swarm keys. A small number of Swarm keys cannot be automatically converted. We are improving Kompose so that it can convert these keys in the future. When warnings appear, modify the Swarm Compose file based on the warning information and use Kompose to convert the file again. For more information about the exceptions that may occur during conversion and how to handle them, see Troubleshooting.
  3. Modify the generated Kubernetes resource files.
    After the Swarm resource file is converted to Kubernetes resource files, modify the generated Kubernetes resource files to migrate the keys that cannot be converted by Kompose. These keys include:
    • aliyun.routing.port_
    • aliyun.global
    • external
    • environment: constraint
    • extra_hosts
    • net
    • dns