Is it possible to run docker-compose projects inside kubernetes?

Archived post. New comments cannot be posted and votes cannot be cast.

I've tried kompose in one project and had some issues with it (don't really remember what was the problem, I think not all compose fields are easily translatable to kubernetes objects). I guess I'll look into it again to see if it works for those projects.

More replies More replies

I don't care about HA for those projects

If you are running in Kubernetes, you need to speak in the language where HA is possible. So all the assumptions of running on one node become problematic (storage, network, etc). And places where you could force it to not be HA are not best practices Or are complicated or brittle, like tying to a specific node for local storage.

You could run Docker Compose style on the same container engine running your k8s, like with nerdctl. But that seems icky.

But in the end, if you are looking for simplicity. Rethinking the assumptions made with Docker Compose in the new syntax is going to work out a lot better in the long run. Kompose gets you most of the way there and where it doesn't work are the places that need human thought about how you are running your k8s architecture.

There is a project that converts docker-compose files to Kubernetes files. I tried it a year ago, but wasn't working so well for me, especially local files. The name is Kompose

Yea that was my experience with Kompose as well, that's why I thought maybe it's possible to just run compose inside pod without any translation :P
Just like you I've tried it some time ago, maybe it'll work better this time.

More replies More replies

It's so bad it's nearly pornographic.

from

Yea, compose inside kubernetes cluster deserves NSFW

More replies

The work it would take ChatGPT to convert your compose to a working group of k8s manifest is so small it’s concerning you’d choose such an anti pattern.