top | item 38142230

(no title)

technosophos | 2 years ago

Helm is a package manager for Kubernetes, and I am one of its maintainers.

Kubernetes objects can be defined in JSON or in YAML. Helm added a template language on top of YAML (based on Go's template system). It has always been an ugly thing, though it functions.

One thing we really wanted to do in the Version 3 release a few years ago was make it possible to write Kubernetes definitions in Lua instead of YAML. Then we wouldn't need a template language. Additionally, we got all the benefits of a procedural language and a way to do inheritance (which would have been profoundly powerful as an alternative to literally hundreds of lines of boilerplate YAML). And it made extending other people's work nearly trivial. All in all, it looked like a far superior path to YAML with text templating.

We produced a POC, defined a specification, and went a good way down the implementation path before a few people in the Helm community voiced such noisy objections that we walked it back.

Their primary objection was simply that they didn't want the procedural logic and the definition to be "the same thing." It was better, in their minds, to have a static file format with a template language layered on top, because that was an appropriate separation of concerns.

I've had a few years now to reflect. And I do think Helm would have been better with Lua.

discuss

order

rocmcd|2 years ago

Thanks for the great work on Helm! Ugly but functional is a great description of the Go templating syntax, and it is definitely my least-favorite thing in Helm.

Do you have links or anything else you can share on the Lua specification work? I'd be interested to see what a Lua-based chart would look like.