What is KYAML?
KYAML (Kubernetes YAML) is a safer, less ambiguous subset of YAML. It was introduced as an alpha feature in Kubernetes v1.34 and graduated to beta, enabled by default, in Kubernetes v1.35. The idea is simple: keep everything good about YAML — comments, readability, no mandatory quotes on keys — but remove the parts that quietly bite you in production.
Crucially, KYAML is not a new format. Every KYAML document is also a valid YAML document, so it works with existing parsers and tooling — kubectl, Helm, kustomize, yq, and any YAML library — with no special flags required on the cluster side.
Why does it exist? The YAML footguns
YAML is friendly to read and treacherous to parse. The problems KYAML targets are not hypothetical — they cause real outages:
- The "Norway problem": write a list of country codes and
NO(Norway) is silently parsed as the booleanfalse. The same happens withYES,ON,OFF, and friends. Your config is syntactically valid and semantically wrong. - Implicit type coercion: a version like
1.20becomes the number1.2; a ZIP code or git SHA made of digits becomes an integer (and loses leading zeros); a time like1:22:33can be read as a sexagesimal number. - Whitespace sensitivity: a single misplaced space changes the structure of the document. This is especially painful in templating engines like Helm, where indentation has to survive being spliced across template boundaries.
How KYAML fixes them
KYAML removes ambiguity by enforcing a small set of explicit rules:
- Braces
{ }for maps and brackets[ ]for lists — structure is delimited, not indented, so indentation can no longer change meaning. - All string values are double-quoted, which eliminates the Norway problem and accidental type coercion outright.
- Keys stay unquoted and comments stay — so it reads better than JSON, and unlike JSON it allows trailing commas.
The same Pod, in classic YAML and in KYAML:
# classic YAML — implicit types, indentation-driven
apiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
app: demo
spec:
containers:
- name: nginx
image: nginx:1.20 # becomes nginx:1.2 if you forget the quotes# KYAML — explicit, whitespace-insensitive, no type surprises
{
apiVersion: "v1",
kind: "Pod",
metadata: {
name: "my-pod",
labels: { app: "demo" },
},
spec: {
containers: [{
name: "nginx",
image: "nginx:1.20",
}],
},
}YAML vs JSON vs KYAML at a glance
KYAML deliberately sits between the two: as readable as YAML, as unambiguous as JSON, and a valid subset of both worlds.
| Aspect | YAML | JSON | KYAML |
|---|---|---|---|
| Comments | ✅ Yes | ❌ No | ✅ Yes |
| Trailing commas | — (no commas) | ❌ No | ✅ Yes |
| Structure defined by | Indentation | Braces / brackets | Braces / brackets |
| Whitespace-sensitive | ⚠️ Yes | ❌ No | ❌ No |
| String values need quotes | Optional (footgun) | Required (double) | Required (double) |
| Keys need quotes | Optional | Required | Optional |
| Implicit type coercion (Norway problem) | ⚠️ Yes | ❌ No | ❌ No |
Multi-document (---) | ✅ Yes | ❌ No | ✅ Yes |
| Is valid YAML | ✅ Yes | ✅ Yes (subset) | ✅ Yes (subset) |
| Readability / diff-friendliness | High | Medium | High |
Try it: convert YAML to KYAML
Paste any YAML below and get equivalent KYAML instantly. The conversion is lossless: the converter parses your YAML, emits KYAML, then re-parses that output and compares the data — the “Verified” badge confirms both represent identical structures.
Runs entirely in your browser. Parses with a YAML 1.2 parser, emits KYAML, then re-parses the result and compares the data — so a “Verified” badge means the conversion is lossless. Comments are not carried over.
Where is it already used?
- kubectl: starting with v1.34 you can request KYAML output with
kubectl get … -o kyaml(in 1.34 it is gated behindKUBECTL_KYAML=true). It is a drop-in replacement for-o yamlwhen you want unambiguous, copy-paste-safe output. - Helm & Kustomize: because all strings are quoted and indentation no longer affects structure, KYAML is a much safer target for templating and overlays. The
sigs.k8s.io/kustomize/kyamllibrary underpins much of this tooling. - GitOps and CI/CD: explicit, diff-friendly manifests are easier to review and far less likely to fail silently in an automated pipeline.
Adoption is meant to be gradual: KYAML is most valuable first for security-sensitive configs where a coerced value is most dangerous, then for new manifests, while your existing YAML keeps working untouched.
Editing KYAML comfortably in JetBrains IDEs
KYAML is easier to parse than YAML, but the explicit braces and mandatory quotes mean you really want an editor that understands the format — matching brackets, validating structure, and navigating keys for you. That is exactly the gap the KYAML plugin for IntelliJ-based IDEs fills, with first-class language support:
- Syntax highlighting with readable colors and styles
- JSON Schema support — autocompletion and validation
- Brace matching and auto-insertion for brackets and quotes
- Code folding, formatting, and syntax validation with error annotations
- Structure View, Breadcrumbs, and Go to Symbol for fast navigation
It works across the IntelliJ Platform (IntelliJ IDEA, PyCharm, GoLand, WebStorm, and the rest), so KYAML files get the same editing comfort as any first-class language in your IDE.
See the KYAML plugin on JetBrains Marketplace →
Should you switch today?
There is no rush and no migration cost: KYAML is a superset-compatible subset, so you can adopt it file by file while everything else stays as it is. If you have ever been burned by a quietly coerced value or a stray space in a Helm template, KYAML is a low-risk way to make those whole classes of bugs impossible.