3 ms·
I think it's more of a progression thing. The config file starts out pretty simple, enough where one of the text file formats is clearly the right solution and
by ufmace 3y ago
I think it's more of a progression thing. The config file starts out pretty simple, enough where one of the text file formats is clearly the right solution and code is over-complex. But then it grows and grows, continuing to accumulate more depth and use more features of the format, and maybe some hacky extensions. At some point, it gets complex enough that, if you designed it from the start with that feature set, being code would obviously be the right solution. But now the transition over is hard to pull off, so it tends to get put off for longer than it should be.
- valenterry 3y agoI would like to believe it, but I have my doubts. For instance looking at kubernetes, do you really think they didn't know in advance how complex things would get? My explanation is different: often configuration files are used for things that are close to infrastructure/operations and those are done by folks who are already used to yaml and who are not used to high level coding as much. It's probably not a concious decision by them, it's just what they believe is the best.
- yeck 3y agoK8S maintains the internal state of the system in JSON which is easy to convert to YAML which is seen as more readable in comparison. I think their choice to support JSON and YAML as an interface for configuring K8S is because of this. I'd also guess that the expectation was that abstractions would form around YAML to make it more powerful. Helm uses Go templating language which supports logic and loops (but is very unpleasant to write complex configs with) and the operator pattern is also popular for more advanced cases. Ultimately both end up exposing some JSON/YAML interface for configuring, though. It is up to you to decide how you create that JSON/YAML.
- valenterry 3y agoThey could have chosen Dhall as well, which also converts to json (or YAML). So I have to wonder: why did they choose YAML in the end? > I'd also guess that the expectation was that abstractions would form around YAML to make it more powerful. Yeah, now you have 3 layers: you have an arbitrary abstraction which is likely different for every tool, then you have yaml and then you have the internal json. That seems like a loss to me in terms of complexity.
- ianburrell 3y agoDhall was first released in 2018. Helm was started in 2015. Helm did flirt with using Jsonnet which would have been better, but I think they already had charts using templates.
- valenterry 3y agoWell, okay, very fair point. They shall be forgiven then. :-)