4 ms·
> If your Docker Compose workflow is overly complex, just convert it to Kubernetes YAML. We all use Kubernetes these days, so why even bother about this? I fin
by mrighele 1y ago
> If your Docker Compose workflow is overly complex, just convert it to Kubernetes YAML. We all use Kubernetes these days, so why even bother about this?
I find that kubernetes yaml are a lot more complex than docker compose. And while I do, no, not everybody uses kubernetes.
- vbezhenar 1y agoI disagree with you on that. Kubernetes YAML is on the same level of complexity as docker compose and sometimes even easier. But verbosity - yeah, kubernetes is absolutely super-verbose. Some 100-line docker-compose could easily end up as 20 yamls of 50 lines each. kubectl really needs some sugar to convert yamls from simple form to verbose and back.
- physicles 1y agoWe have about 30 services running in 4 environments, including dev. I desperately want a better kustomize that removes most of the boilerplate and adds linting (like, every process should have a ram limit, but no cpu limit). I estimate about 75% of the lines of YAML are redundant.
- ThatFave 1y agoHave you thought about using jsonnet? It has a good library for k8s (https://jsonnet-libs.github.io/k8s-libsonnet/ https://jsonnet-libs.github.io/k8s-libsonnet/). I like how I don’t need to worry about white spaces and how I can use functions to reduce boilerplate. For an example environment: https://github.com/ThatFave/homelab https://github.com/ThatFave/homelab
- physicles 1y agoIs that intended to be a good example? There's still tons of duplication between the environments. Kustomize eliminates the vast majority of the duplication (i.e. a unique fact about the cluster being expressed in more than one place), it's just the boilerplate that's annoying.
- ThatFave 1y agoNot a good one, no. I am currently in the process of rewriting this, so that I eliminate duplicate code. The language has the potential, I am still in the process of learning. I also dislike boilerplate, but I think my example is still better than pure yaml.
- Kovah 1y ago> Kubernetes YAML is on the same level of complexity as docker compose > Some 100-line docker-compose could easily end up as 20 yamls of 50 lines each. Yeah, nothin to add here.
- esseph 1y agoHaving an LLM function as a translation layer from docker compose to k8s yaml works really well. On another note, podman can generate k8s yaml for you, which is a nice touch and easy way to transition.
- pvtmert 1y agoBoth (K8s and Compose) are well defined schemas, hence the conversation is mere mapping via search & replace. Bunch of `sed` statements could do that, LLM is an overkill for the job. Meanwhile, kompose.io exists, which is exactly what it does (but with Go templates as far as I can tell)
- physicles 1y agoFor toy projects, sure. For production, the probability that the LLM would sneak in some subtle typo is just too high.
- politelemon 1y agoUse an LLM is not a solution. It's effectively telling you to switch your brain off and hope nothing goes wrong in the future. In reality things do go wrong and any conversation should be done with a good understanding of the system involved.
- brennyb 1y ago"Using an IDE is not a solution" same arguments, same counter arguments. An abstraction being leaky does not mean it's useless. You will always need to drop down a layer occasionally, but there's value in not having to live on the lower layer all the time.
- lmm 1y agoThe difference being that when your IDE makes a mistake you can understand and debug it, and maybe even patch it to fix it (or failing that at least understand what triggers it and work around it).
- 1y ago
- osigurdson 1y agoI don't know how to create a compose file, but I do know how to create a k8s yaml. Therefore, compose is more "complex" for me.
- 0_gravitas 1y agoThis is a conflation of "Simple" and "Easy" (rather, "complex" and "hard"). 'Simple vs Complex' is more or less objective, 'Easy vs Hard' is subjective, and changes based on the person. And of course, Easy =/= Simple, nor the other way around.
- hamdingers 1y agoI'm a CKA and use docker compose exclusively in my homelab. It's simpler.