This topic describes how to convert Swarm compose files.
- Use Kompose to convert a Swarm compose file.After a Swarm compose file is pre-processed, run the following command to convert the file by using Kompose:
kompose-linux-amd64 convert -f source/swarm-piggymetrics.yaml --volumes PersistentVolumeClaimOrHostPathNote If the conversion succeeds, Kubernetes resource files are generated. Warnings appear for labels that cannot be automatically converted. Use one of the following methods to process these labels:
- Modify the Swarm compose file and use Kompose to convert the file.
- Modify the generated Kubernetes resource files.
- Ignore the warnings. Deploy the generated Kubernetes resource files. Then, log on to the Container Service for Kubernetes (ACK) console and manually migrate the configurations.
- Modify the Swarm compose file.Kompose can convert most Swarm labels. A small number of Swarm labels cannot be automatically converted. Kompose will be optimized to support more labels. 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 these exceptions, see Troubleshooting.
- Modify the generated Kubernetes resource files.After a Swarm compose file is converted to Kubernetes resource files, modify these Kubernetes resource files to migrate the labels that cannot be converted by Kompose. These labels include:
- environment: constraint