Tecnativa / doodba-scaffolding

Officially supported scaffolding template for your Doodba projects
Other
11 stars 38 forks source link

Compose v3 #70

Closed yelizariev closed 4 years ago

yelizariev commented 4 years ago

I tried kompose convert to play with k8s deployment and found that it doens't support support v2.4. Some googling quickly land me to 2,5 year old comment from @Yajo https://github.com/moby/moby/issues/31101#issuecomment-330152093. So, ...

I didn't test and just followed the docs. I need your opinion before proceeding.

yelizariev commented 4 years ago

Travis is green :green_heart:

yajo commented 4 years ago

Hmm this is something that I've been delaying because there have been several alternatives and I wanted to see how they evolve. The lack of extends support indeed is what led me to stay with version 2.x.

I'm not sure this is the right path to follow, since docker-compose v3 seems to fit docker swarm mostly, and nowadays it's pretty clear that's going to die at some point.

One idea that floats over my mind is to use instead kubernetes deployments to be played locally with podman play kube devel.yaml; that should let us develop with podman, which is indeed something better.

Another idea is to use https://github.com/docker/app, but that's still beta and TBH I'd love to be able to get docker out of the picture at some point, switching to podman for devel and k8s for test/prod.

And of course, we cannot forget about https://github.com/containers/podman-compose.

Another idea is to provide some kind of SDK based on Ansible (or possibly https://github.com/ansible/ansible-runner) which would let us automate all doodba-related tasks in an easier and more extensible way, which could actually support different tooling (docker-compose/app/podman/k8s...) or just one but letting us evolve separately.

I haven't had time to evaluate all options seriously, and the landscape isn't clear about what is going to "win" so I'm not sure I want to make this switch right now... :thinking:

I guess https://github.com/Tecnativa/doodba-scaffolding/pull/69 would let the user at least choose the type and bootstrap the desired files only.

I'd love to hear your thoughts on the subject.

yelizariev commented 4 years ago

True, there are many possible paths... I read a little bit about podman and it looks promising. For production, I'm in favor of k8s, at least because it's the choice of most hosting services, which allow renting prepared k8s.

I'm ok with the decision to don't hurry with such changes. But what would be your advise about what is the shortest way, for now, to run doodba in k8s clusters?

yajo commented 4 years ago

Let me summon @PCatinean who AFAIK already does that. I'm lagging behind in this subject...

PCatinean commented 4 years ago

Kompose convert will not cut it in this case i'm afraid. The way I do it is with an in-house built helm chart called odoo-doodba. It's not very polished but does seem to work. I need to make time in one weekend to submit a PR for this as well as the other outstanding one I got for generating config from env variables :)

yajo commented 4 years ago

One possibility is to make these compose files compatible with podman-compose, which is compatible with docker-compose v2 files.

After that's done, you can do podman generate kube $pod and it generates a k8s yaml for you to deploy.

WDYT?

PCatinean commented 4 years ago

I did not research that part at all to be honest but there are multiple issues I ran across that could not be fixed by these conversion binaries. One such case from memory is that when volumes are created by the storage provisioner they have default root user and need chown 1000. I did this via an init-container that executes before the main container starts. A few other cases like these need manual tweaks.

yajo commented 4 years ago

https://fosdem.org/2020/schedule/event/ephemeral/ showcases several k8s tools, not sure if you k8s pros can evaluate those also...

yelizariev commented 4 years ago

@PCatinean is odoo-doodba something you can share with me or even make public?

PCatinean commented 4 years ago

@yelizariev I suppose it's only fair, after all I got hold of this awesome project without lifting a finger :P

I just published the chart in the current yet unpolished state: https://github.com/pledra/helm-charts

Enjoy!

yelizariev commented 4 years ago

Cool! That's where I can start my k8s\helm adventure.

Just one question. In projects where you use helm, do you use doodba-scaffolding? E.g. to to build the image or testing\development?

PCatinean commented 4 years ago

Yes that's the base, though I have a pimped up personal version but it's derived from the standard

yajo commented 4 years ago

Please add the doodba tag to your repo, so users can use that to read related projects.

yajo commented 4 years ago

I think I'm gonna close this PR as it's not going to be merged soon, and when it does it would probably be different.

We can open an issue to discuss project future in this regard if you want, I think it'll be a better place to discuss.

Thanks everyone.