3 ms·
It really depends on what you're configuring. I like TOML for most cases since it has the right balance of simplicity and expressiveness. JSON could in theory s
by goku12 3y ago
It really depends on what you're configuring. I like TOML for most cases since it has the right balance of simplicity and expressiveness. JSON could in theory support everything that TOML can - but it can be jarring to look a large config file with just brackets/parenthesis to demarcate blocks. Even YAML finds its niche applications. I don't think JSON or TOML are good substitutes for YAML in case of Kubernetes. Kubernetes needs a single format that can act as a config language (in case of spec) and as a serialization format (in case of state). YAML fulfills that without being overly verbose. We probably shouldn't get too attached to a config language.
- seabass-labrax 3y agoInternally, Kubernetes uses a key-value structure, and it doesn't mind what syntax you use to write your configuration files as long as it is passed via the HTTP+JSON API correctly. It's a relatively pedantic detail, but I think it supports the argument that YAML is the best tool for the job currently. Kubernetes' architecture would make it trivial to add TOML, XML or even s-expression support into the CLI tooling, but people don't seem to particularly want to.
- mdaniel 3y agoto the very best of my knowledge, its input api payloads are always content-type:application/json; one can see this in effect via `kubectl --v=100 apply -f some.yaml` and watch it serialize that yaml to json _then_ POST it
- goku12 3y agoThanks for adding. Your argument demonstrates that there is an optimum human-friendly representation for each data.