Can you with yaml? Helm tries, but isn't that great, jinja ( depending on how its done ( jinja in yaml as in ansible or jinja to yaml as in SaltStack)) does an ok job, but fundamentally managing a language which uses spaces for logic with code is hard, and certainly YAML wasn't created to be managed that way.
JSON i agree, you can easily convert your language of choice's data structures to it. But do you have to? It adds another layer of complexity, and you can have unexpected bugs ( since you have a logic layer that creates JSON, which could be wrong due to a logical error).
HCL is a DSL that needs learning and few use outside of Hashicorp products, but IMHO it's not that hard ( docs are great, tutorials are plenty) and it's worthwhile to have data+logic in the same human and machine readable layer.
In any case, Nomad accepts JSON for everything ( mostly for when non-humans interact with it).
I intend to write an OSS version of it because Jsonnet really is probably the best fit here (though Cue/Dhall are interesting I think Jsonnet is easiest to get others to adopt).
kubectl is close but doesn't understand secrets/variables, the concept of clusters, or changing image tags programmatically. It's difficult to get right.
Isn't that the problem kustomize (which kubectl now has native support for applying) is trying to solve? I ask that honestly, because I haven't used kustomize in anger in order to compare its workflow to that of helm
I need to check out kubecfg, I haven't used it yet.
Definitely agree that it's difficult to get right but the authors of the tool definitely struck a really good balance.
Hopefully if I implement it myself I can do their original design and implementation justice.
That seems a lot better than either SaltStack's use of Jinja (using text-based templating on a structured format) or Ansible's (using YAML as syntax for an imperative programming language that has Jinja-evaluation functionality).
"For machine-friendliness, Nomad can also read JSON-equivalent configurations. In general, we recommend using the HCL syntax."
https://www.nomadproject.io/docs/job-specification#job-speci...
With Kubernetes, you can even use one of the many native clients (and/or protobuf) which makes converting from something else a breeze, avoiding the JSON/YAML entirely. You get static typing, you can write tests, etc.
You can easily write tools that generate json/yaml for you based on your needs. For most applications you're deploying you'll need:
1. A Deployment
2. A Service that points to that Deployment
3. An Ingress or similar
In some cases you'll want to manage persistent state on disk and you'll need a StatefulSet.
A good example of this can be seen https://youtu.be/keT8ixRS6Fk?t=1317 and https://youtu.be/muvU1DYrY0w?t=581