TL;DR
- Three different approaches to dynamic configuration:
- Templating
- Examples: Helm, gomplate, etc.
- Text templating very quickly becomes fragile, hard-to-understand, and hard-to-maintain.
- Template writers lack the tools to build abstractions around the data.
- Layering
- Examples: kustomize
- Data layering breaks down when configurations grow in complexity and scale.
- Template writers lack abstraction and type validation.
- For large scale projects, inheritance creates deep layers of abstractions.
- Semantics are locked into an opaque tool and not exposed as language features.
- Data Configuration Language (DCL)
- Any declarative systems and tools that grow in size and complexity need to be abstracted.
- CUE is a language for defining, generating, and validating all kinds of data.
- CUE is designed around graph unification.
- Sets of types and values can be modeled as directed graphs and then unified to the most specific representation of all graphs.
- CUE makes tasks like validation, templating, querying, and code generation first class features.
- CUE’s type system is expressive. For a given field, you can specify the type as well as optionality and constraints from other fields.
- CUE also has a declarative scripting layer built on top of the configuration language.
Read More