6 ms·
> You can easily write tools that generate json/yaml for you based on your needs. For most applications you're deploying you'll need: Can you with yaml? Helm t
by sofixa 6y ago
> You can easily write tools that generate json/yaml for you based on your needs. For most applications you're deploying you'll need:
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).
- gravypod 6y agoHelm, in my personal opinion, is one of the biggest mistakes of the kubernetes ecosystem. Not embracing Jsonnet, Cue, Dhall, or even an in-language DSL like Pulumi has set the usability of kube back quite far.
- jpgvm 6y ago$DAY_JOB replaced helm with custom tool that does equivalent of kubectl apply by uses Jsonnet as templating engine. 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).
- gravypod 6y agoI've done the same in the past. The important thing is making it so it's easy to build up abstractions and to work in a sensible deployment flow. kubectl is close but doesn't understand secrets/variables, the concept of clusters, or changing image tags programmatically. It's difficult to get right.
- jpgvm 6y agoYeah this is all stuff this tool understood, multiple clusters, managing kube contexts, external secret storage or k8s secrets, native git integration, etc. 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.
- mdaniel 6y ago> 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
- etse 6y agoI also did something like this a few years ago (with Go templating instead of Jsonnet), but we recently replaced it with Kustomize (https://kustomize.io/ https://kustomize.io/) as it worked quite well for the basic use case of getting shared Kubernetes configs to deploy code to different environments at different times.
- atmosx 6y agoThe fact that trivial things like ingresses don’t have transformers is a PITA.
- qbasic_forever 6y agoNo need to build it, there's already kubecfg: https://github.com/bitnami/kubecfg https://github.com/bitnami/kubecfg
- rickspencer3 6y agoWe use this heavily at InfluxData to manage multiple clusters in multiple regions of multiple clouds. One of the maintainers of kubecfg recently joined InfluxData as well.
- qbasic_forever 6y agoHelm isn't that connected to the broader Kubernetes system. It was popular in the early days when Kubernetes knowledge was sparse and things were still being figured out. None of the official Kubernetes docs really mention or describe using helm, and I see more getting started tutorials are starting to avoid it too. The official kubectl tool supports a -k mode which applies Kustomize logic and I'd argue Kustomize is probably the official way forward with app deployments by the Kubernetes project.
- KptMarchewa 6y agoYet, the embedded kustomize version is years behind standalone. https://github.com/kubernetes-sigs/kustomize/issues/1500 https://github.com/kubernetes-sigs/kustomize/issues/1500
- geofft 6y agoA team at my workplace uses Jsonnet for this problem and it seems to work very well. It's a nicely human-readable DSL for generating JSON in a way that respects JSON structures - you can construct lists of objects (deployments, services, etc.) by looping over templates and composing modifications. 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).