What KYAML is
Instead of introducing a new configuration language, SIG CLI introduced KYAML, a stricter, more consistent way to write YAML. [1]
KYAML is a strict subset (or "dialect") of standard YAML, designed to be parseable by the existing ecosystem without any changes, as proposed in KEP 5295. [2]
Why a subset instead of a new language
The interesting part is that Kubernetes doesn't actually need most of those features. [3]
This led to a simple question: if Kubernetes only needs a small part of YAML, why not standardize on that part and avoid the rest? [4]
The YAML choices that cause trouble
Indentation defines structure in YAML, which means a wrongly indented file can remain syntactically valid while representing a different object than intended. [5]
String quoting is optional in YAML, which sounds convenient until it is not. [6]
Some values that look like strings get coerced into other types without warning. [7]
Sources
- The Kubernetes project source says: Instead of introducing a new configuration language, SIG CLI introduced KYAML, a stricter, more consistent way to write YAML. How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: KYAML is a strict subset (or "dialect") of standard YAML, designed to be parseable by the existing ecosystem without any changes, as proposed in KEP 5295. How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: The interesting part is that Kubernetes doesn't actually need most of those features. How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: This led to a simple question: if Kubernetes only needs a small part of YAML, why not standardize on that part and avoid the rest? How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: Indentation defines structure in YAML, which means a wrongly indented file can remain syntactically valid while representing a different object than intended. How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: String quoting is optional in YAML, which sounds convenient until it is not. How to Pretty-Print Your Kubernetes YAML as KYAML
- The Kubernetes project source says: Some values that look like strings get coerced into other types without warning. How to Pretty-Print Your Kubernetes YAML as KYAML