top | item 45904202

(no title)

greenwallnorway | 3 months ago

Can I hear from those of you who have had a good IAC experience? What tools worked well?

discuss

order

badLiveware|3 months ago

ArgoCD + Helm

But really any kind of reconciler, e.g. flux or argo with helm works very well. Helm is only used as a templating tool, i.e. helm template is the only thing allowed. It works very well and I've ran production systems for years without major issues.

I dont really understand how people have so much trouble with Helm, granted yaml whitespace + go templating is sometimes awful, it is the least bad tool out there that I have tried and once you learn the arcane ways of {{- its mostly a non-issue.

I would recommend writing your own charts for the most part and using external charts when they are simple, or well proven. Most applications you want to run arent that complicated, they are mostly a collection of environment variables, config files, and arguments.

If I could wish for a replacement of helm, it would be helm template with the chart implemented in a typed language, e.g. TypeScript, instead of go template but backwards compatible with go template.

trenchpilgrim|3 months ago

I wrote Go and Python programs that constructed the manifests using the native Kubernetes types and piped them into kubectl apply. Had to write my own libraries for doing migrations too. But after that bootstrapping it worked great.

anttiharju|3 months ago

Reminds me of cdk8s if one is looking for a framework if it can be called that

cdk8s.io

vbezhenar|3 months ago

Kubernetes API uses JSON. JSON is JavaScript Object Notation. So naturally the best approach to work with JSON is to write JavaScript or TypeScript code. You can just output JSON and consume it with kubectl. You can read data from whatever format you want, process it and output JSON. You can write your little functions to reduce boilerplate. There are many options that are obvious once you just embrace JavaScript.

Of course most other programming languages will work just as well, it's just JavaScript being the most natural fit for JSON.

HumanOstrich|3 months ago

> Kubernetes API uses JSON. JSON is JavaScript Object Notation. So naturally the best approach to work with JSON is to write JavaScript or TypeScript code.

I don't really like this superficial reasoning. You can specify, generate, parse, and validate JSON in many common languages with similar levels of effort.

Saying you should use JavaScript to work with JSON because it has JavaScript in the acronym is about as relevant as comparing Java to JavaScript because both have Java in the name.

trenchpilgrim|3 months ago

There are some features of Kubernetes that are only available in the Go client like Informers. So Go is a much more natural fit (you can move between JSON and Go structs with one function call + error check)

preisschild|3 months ago

Im quite happy with FluxCD+Helm. Helm also supports creating library charts (basically component libraries) that can improve the experience of creating and maintaining helm charts by a lot.

fjsdkfjwjd|3 months ago

I like pulumi (iff typescript) and cdk8s.

terraform with helm/kubernetes/kubectl providers is hit or miss. But I love it for simple things. For hairy things I will want full TypeScript with Pulumi.

tribaal|3 months ago

Probably an unpopular opinion, but it’s been a couple of jobs that I write “just python” to generate k8s manifests, and it works really, really well.

There’s packages. You can write functions. You can write tests trivially (the output is basically a giant map that you just write out as yaml)…

I’m applying this to other areas too with great success, for example our snowflake IaC is “just python” that generates SQL. It’s great.

Too|3 months ago

Terraform. It’s declarative, type safe and just expressive enough to create basic conditionals, loops and reusable modules. Providers exists for all clouds and k8s.

Now it’s not perfect either. It does have some issues with slow querying of the current state during planning, even when it has the tfstate as a cache, which is another source of errors.

mattcanhack|3 months ago

Like the others, I'm using a programming language except it is Javascript because we're a Node.js company. It actually works well enough