4 ms·
I wonder why generated JSON is not used more widely, something like jsonnet[0], although I've never used it. Most systems come with Python 3 installed, which s
by polyrand 4y ago
I wonder why generated JSON is not used more widely, something like jsonnet[0], although I've never used it.
Most systems come with Python 3 installed, which supports working with JSON[1] without installing any dependencies. So, I'm wondering if we could use Python to generate JSON data that is then consumed by other tools. This would fix the lack of comments and trailing commas in JSON, you get functions and other abstractions from Python, and you don't need to install any third-party tools (vs. something like jsonnet).
[0]: https://jsonnet.org/ https://jsonnet.org/
[1]: https://docs.python.org/3/library/json.html https://docs.python.org/3/library/json.html
- reilly3000 4y agoI’m at a crossroads and evaluating whether to introduce jsonnet to my org. We are doing a massive conversion of legacy yaml manifests from a proprietary vendor format, and there are not a lot of chances like this where you can make such a change at scale. Any experience reports or advice on jsonnet would be appreciated.
- Duologic 4y agoAt Grafana Labs we're using jsonnet at scale, while being a powerful functional language it is also excellent for rendering JSON/YAML config. We have developed Tanka[0] to work with Kubernetes, for other purposes I can recommend this course[1] (authored by me). [0] https://tanka.dev/ https://tanka.dev/ [1] https://jsonnet-libs.github.io/jsonnet-training-course/ https://jsonnet-libs.github.io/jsonnet-training-course/
- reilly3000 4y agoWow I love it here. Where else can you post something and get a project leader chiming in within hours? We are at a crossroads in moving towards GitOps and a CD vendor change, and are forced into some manifest conversion. From where we are coming from Helm is the obvious choice, but I do think we can do better, especially for debugging, readability, and inheritance. ArgoCD’s support for jsonnet turned me onto it and Tanka, and now I’m going to take it for a more serious spin. I’m early days with it but I’m curious about how life is with having a compiled language for an infra development. I had the same reluctance when thinking about making the Typescript leap, but that turned out just fine. I kinda want to jsonnet all the things if it works out well, but I worry the compilation steps would make it cumbersome for some use cases.
- Duologic 4y agoHit me up on the #jsonnet channel on Kubernetes Slack or the #tanka channel on Grafana Slack if you want to go a bit more in depth.