NEWS

KYAML becomes default beta in Kubernetes 1.35 and changes how you write manifests

Strict YAML subset makes objects, arrays, and strings explicit to reduce classic indentation and type coercion errors. It requires no new parser or migration.

KYAML becomes default beta in Kubernetes 1.35 and changes how you write manifests
Image: Redação iMasters

The Kubernetes project is encouraging people who work with clusters to take a close look at KYAML, a stricter YAML dialect created to make configuration more explicit, predictable, and less prone to the format's classic errors. According to InfoQ's coverage of the official Kubernetes blog post, KYAML landed as an alpha feature in version 1.34 and moved to beta, enabled by default, in 1.35.

The point that avoids panic: KYAML is not a new configuration language. It's a strict subset of YAML, which means YAML parsers and all of Kubernetes' existing tooling keep processing the files normally. Instead of disrupting the ecosystem, KYAML just reduces the number of syntactic choices you need to make when writing a manifest.

Why YAML gives you a headache

YAML caught on in Kubernetes because it's human-readable and supports comments. But that same flexibility comes at a cost. Indentation defines structure, so one extra or missing space changes the meaning of the document. And unquoted values can be interpreted as a different type than you intended: the most famous case is implicit coercion, where no becomes the boolean false or a version like 1.20 becomes a number.

These problems get worse when manifests are generated or manipulated by templating systems like Helm, a situation that's the rule rather than the exception in production.

What changes in the syntax

KYAML adopts a more explicit approach that, in practice, looks quite a lot like JSON, but remains valid YAML:

| Element | Conventional YAML | KYAML | |---|---|---| | Objects | indentation | {} | | Arrays | - with indentation | [] | | Strings | optionally unquoted | double quotes required | | Comments | supported | supported | | Trailing comma | no | supported |

By forcing double quotes on strings and explicit delimiters, KYAML eliminates indentation ambiguity and implicit type coercion, while keeping useful YAML features like comments and trailing commas.

You don't need to rewrite anything by hand

This is the most important point for everyday work. Kubernetes now supports -o kyaml as a kubectl output format, and tools like the Kubernetes project's yamlfmt and Google's yamlfmt convert existing YAML to KYAML.

In other words, you can pretty-print a resource that's already running in the cluster:

bash
kubectl get deployment minha-app -o kyaml

And since the output remains valid YAML, the project notes that KYAML can even be consumed by older versions of kubectl. The barrier to experimenting is low: you can adopt it in a single repository, in a specific pipeline, or configure your tooling to prefer the format, without breaking anything around it.

Kubernetes won't make KYAML the default

On purpose. Conventional YAML keeps working, and whoever prefers the explicit syntax adopts it selectively. This positions KYAML as an incremental engineering practice, not a disruptive migration. For Brazilian teams that maintain dozens or hundreds of manifest repositories, this means adoption can be gradual, starting where the ambiguity hurts most (complex Helm charts, for example) without a mass rewriting effort.

The timing and the AI factor

The angle that matters to builders: Kubernetes configuration is increasingly generated, not hand-written. Helm, GitOps platforms, infrastructure-as-code systems, and, increasingly, AI coding agents produce or modify manifests.

This makes ambiguity more costly. A human developer usually catches an indentation problem or an unexpected value when reviewing a small manifest. An automated system that generates hundreds of resources has fewer opportunities for contextual judgment. A stricter representation reduces the number of ways to express the same configuration and makes structural and type errors easier to spot, both for humans and machines.

That's where KYAML becomes especially interesting in an environment with AI in the loop. If agents take on part of the manifest creation and modification, a restricted dialect gives them fewer syntactic decisions to make, making the output more deterministic and easier to validate automatically. For a validation pipeline (policy-as-code, manifest testing), less variation means fewer false positives and cleaner diffs.

A pattern that follows the trend

KYAML reflects a broader movement in engineering: trading flexibility for consistency. It's the same principle behind opinionated formatters, linters, strongly typed APIs, policy-as-code, and platform engineering's "golden paths".

Standardizing how configuration is represented makes code review easier, reduces meaningless formatting differences, improves diffs, and makes automated validation more reliable. It also gives platform teams one more mechanism to establish consistent practices across many repositories at once.

As InfoQ's coverage sums it up, KYAML's strongest argument might be that it doesn't ask you to learn something completely new: it just removes unnecessary choices from a format you already use. What remains open is how much of the ecosystem (Helm, operators, CI tools) will adopt KYAML as a default output, and whether AI agents will actually take advantage of the restriction to generate more reliable configuration. For now, the cost of trying it is a -o kyaml in your CLI.

Translated from the Brazilian Portuguese original · Read the original