(no title)
yuretz
|
2 years ago
This is the case with any other declarative programming system: while you only care about "what", i.e. the end result matching your declarative specification, you are living a dream. Once you need to fine-tune the details of how you get there (e.g. performance, resource use), or tweak the end result in a way that is not easy to describe within the constraints of your declarative dream land, things get ugly pretty quickly. Query hints in some SQL dialects, vendor-specific hacks in HTML/CSS, Kubernetes YAML templating, etc. are all sad stories about it.
nightowl_games|2 years ago
ekimekim|2 years ago
You see the same thing with the C preprocessor - there's a very good reason that basically no language since has copied that design, and it's infamous for being full of footguns.
A far simpler and more manageable solution is to generate the same data structure (the final manifest) in a language which can actually represent those data structures directly. That might be a dedicated language like Cue or Jsonnet, or it could just be a general purpose programming language. You can generate the data structure using whatever tools you like, and then render it to JSON or YAML to be consumed by whatever tool is uploading it to kubernetes (kubectl apply, helm, etc).
infogulch|2 years ago
mst|2 years ago
It looks like you can plugin in your own templating script to the helm stuff though, I was thinking that something like https://yglu.io could retain the essential YAML-ness for comprehensibility to others while not being completely ridiculous like using a text templating system is.
yuretz|2 years ago
rad_gruchalski|2 years ago
Jsonnet is one of the alternatives.