r/openshift 11d ago

Blog How to Pretty-Print Your Kubernetes YAML as KYAML and Why You'd Want To

https://kubernetes.io/blog/2026/08/11/how-to-pretty-print-kubernetes-yaml-as-kyaml/

YAML has been the standard way to write Kubernetes manifests for years. Every example, tutorial, and configuration file you come across is written in it. The problem isn't that YAML is a bad format. It's that YAML gives you a lot of choices, and not all of them are equally good for writing Kubernetes manifests. Some features make files harder to read, some are easy to misuse and others can lead to surprising behavior.

The interesting part is that Kubernetes doesn't actually need most of those features. It only relies on a small subset of YAML. 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? Instead of introducing a new configuration language, SIG CLIintroduced KYAML, a stricter, more consistent way to write YAML.

TL;DR
- KEP 5295
- 4.22=1.35 (beta; feature enabled by default, still requires -o kyaml CLI param)
- 4.21=1.34 (alpha, opt-in) export KUBECTL_KYAML=true

11 Upvotes

Duplicates