←back to thread

1101 points codesmash | 4 comments | | HN request time: 0s | source
Show context
mrighele ◴[] No.45137889[source]
> 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.

replies(3): >>45138013 #>>45138269 #>>45143229 #
vbezhenar ◴[] No.45143229[source]
I 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.

replies(2): >>45146138 #>>45148319 #
1. physicles ◴[] No.45146138[source]
We 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.
replies(1): >>45146537 #
2. ThatFave ◴[] No.45146537[source]
Have you thought about using jsonnet? It has a good library for k8s (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
replies(1): >>45146625 #
3. physicles ◴[] No.45146625[source]
Is 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.

replies(1): >>45146655 #
4. ThatFave ◴[] No.45146655{3}[source]
Not 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.