3 ms·
Yes Kubernetes YAMLs are a PITA. But you can just wrap them in a scripting language like Ruby that makes it easy to create a DSL. [0]: https://www.brightbox.co
by neilwilson 4y ago
Yes Kubernetes YAMLs are a PITA. But you can just wrap them in a scripting language like Ruby that makes it easy to create a DSL.
[0]: https://www.brightbox.com/blog/2020/02/12/rubynetes-kubernetes-config-the-easy-way/ https://www.brightbox.com/blog/2020/02/12/rubynetes-kubernet...
Use a language rather than a tool if you need the flexibility.
- sofixa 4y ago> Use a language rather than a tool if you need the flexibility The problem with a fully fledged language is the flexibility. There is enough of it to make a mess unless you and your teammates are highly skilled and disciplined. Messy code sucks to deal with, debug, modify; let alone when it's infrastructure code where a wrong logical loop can delete your database or persistent volume. Infrastructure as code, not with code. DSLs, with their limitations, ensure there's a lot less you can shoot yourself in the foot with, and that everyone vaguely familiar with that DSL can read your code and be absolutely sure what it does, worst case scenario with a Google search or two. No such thing is possible with code in a language as complex and as flexible as Ruby, Python or JavaScript. Disclaimer: i work at Hashicorp that happens to have one of the most popular IaC DSLs out there, but i have believed that tools like Pulimi are little more than a disaster waiting to happen long before joining.
- KronisLV 4y agoWhat about when you just want things to work, rather than running into some weird abstraction related issues along the way, that you cannot solve due to any such solution not being popular enough for your use case to be covered? That's kind of why personally I'd just go for Helm or something of that variety - popular enough to have plenty of tutorials and answers about it, simple enough to just be viewed as a bunch of templating, going from values.yaml to your filled out template files that can be applied against a Kubernetes cluster. It even generates a lot of what you might need (deployment, service etc.) as a part of the base set of templates, thus you don't have to waste your time trying to write manifests from scratch and have plenty of workable examples for setting env values etc.