6

Kompose translates docker-compose.yml files to Kubernetes config, allowing you to use docker-compose.yaml as a single source of truth if you develop locally with docker-compose and deploy on k8s.

Is there a tool that does the reverse? I'd like to keep my k8s config yamls as the source of truth and generate a docker-compose file programmatically.

Andreas Jansson
  • 3,137
  • 2
  • 30
  • 40

1 Answers1

0

You can try out Move2Kube (https://github.com/konveyor/move2kube). You will have to place all your kubernetes yamls in a folder, and run move2kube using :

move2kube translate -s <folder containing kubernetes files>

It does create a docker-compose.yaml file in the output folder. It does it for most basic elements.

If you want to support more features in the output docker-compose file, you can enhance the docker compose translator of move2kube (https://github.com/konveyor/move2kube/blob/master/internal/transformer/composetransformer.go).