Skip to content

    Back to articles

    6 min read

    KYAML is a toolchain decision, not just safer syntax

    Safer syntax is only one part of the decision

    KYAML addresses real sources of ambiguity in configuration: it quotes string values and uses braces for maps and brackets for lists. Those conventions make structure more explicit than indentation-sensitive YAML. The KYAML design proposal describes the format and its goals.

    The timing is relevant: the Kubernetes v1.37 release announcement says kubectl get -o kyaml has reached Stable. But a stable output option is not, by itself, a reason to rewrite manifests or make KYAML the repository standard. It answers whether Kubernetes offers this format; it does not answer whether the rest of a team’s configuration workflow handles it well.

    I would treat adoption as a toolchain compatibility decision. The question is not only whether the API server can accept a document. It is whether the tools that create, edit, validate, transform, review, and deploy that document can work with it consistently—and whether the safety gain is worth supporting another representation.

    That distinction matters because a parser accepting a file is a low bar. A formatter might rewrite it into a different style. A policy check might inspect text instead of parsed data. A deployment wrapper might assume that generated files look a certain way. None of those outcomes means KYAML is invalid; they mean the toolchain’s assumptions need to be checked before repository conventions change.

    Test the whole path, not just kubectl

    The release announcement says KYAML is valid YAML and can be used as input to kubectl; existing manifests do not have to be rewritten. That makes a staged evaluation possible: keep existing files as they are, and test KYAML where it provides value without forcing a repository-wide migration.

    I would start by tracing a representative manifest through the actual workflow. Include local editing, linting, rendering or generation, policy checks, review, and deployment. The test should exercise the commands and versions used by contributors and automation, rather than relying on a single successful kubectl apply.

    For example, a small ConfigMap can show the syntax change without mixing it up with application behavior:

    ---
    {"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "app-config"}, "data": {"mode": "NO", "enabled": "true"}}

    I would check whether the editor provides useful indentation, completion, and diagnostics for this style; whether the linter parses it and reports the same rules; and whether any renderer or generator preserves the intended format. Then I would run policy checks and the deployment workflow against the rendered result. The aim is not to insist every tool emits KYAML. The aim is to learn where the format enters, where it leaves, and whether a conversion or text-based assumption changes the result.

    I would pay particular attention to scripts that grep, replace, or compare manifest text. Structural tools that parse YAML can work with equivalent data regardless of layout, but a text-based check may depend on line breaks or indentation. That is a design risk to investigate, not a claim that a particular linter or renderer fails. A clear test gives the team evidence about its own toolchain.

    The same applies to review. Compact flow-style documents can make boundaries explicit, but a large nested resource may be harder for a person to scan or review as a diff. I would try the format on the kinds of resources the repository actually maintains. If the syntax reduces ambiguity for one file but makes routine changes harder to understand, that cost belongs in the decision too.

    Mixed formats have a maintenance cost

    Because KYAML is a YAML subset, the format does not necessarily require a new parser at every stage. But compatibility at the parser boundary is not the same as a consistent authoring and review experience. A team can accept both forms while still needing conventions for which form to write, how generated files should look, and whether a formatter is allowed to convert between them.

    That mixed state can be intentional. For instance, a team might use KYAML for output from a specific workflow while leaving hand-maintained manifests unchanged. The cost is then limited but real: contributors need to recognize both styles, and tests or documentation should make clear where each belongs. If each tool chooses its own representation, review diffs can become noisy and people may start “fixing” formatting rather than discussing the change.

    I would avoid a broad migration until I can answer three questions. Which files are authored by people, and which are generated? Which tool is the source of truth for formatting? And can the repository enforce its chosen convention without custom glue that becomes another thing to maintain? If those answers are unclear, adding a second format is likely to make the workflow less predictable, even if each individual file remains valid.

    A conversion step deserves particular scrutiny. It can establish a consistent output format, but it also adds a boundary where comments, ordering, or formatting expectations may change. If conversion is necessary, I would make it explicit and testable rather than letting different editors and CI jobs make silent choices. If no conversion is needed, I would not add one just to claim that the repository has adopted KYAML.

    Adopt it where the benefit pays for the support

    My default would be to evaluate KYAML first as an output format, then consider authoring conventions separately. Stable kubectl output makes it reasonable to test KYAML in workflows that consume command output. It does not require hand-maintained manifests to change. The Kubernetes release announcement explicitly notes that existing specifications and pipelines do not need to change for KYAML to be usable.

    I would adopt it for authored files only when the toolchain passes the same practical checks: contributors can edit and review it comfortably, linters and policies evaluate it as intended, renderers behave predictably, and deployment does not depend on an undocumented conversion. I would also document whether both formats are accepted or whether one is the repository standard. An ambiguous “use either” rule often shifts the decision from architecture to individual preference.

    The trade-off is straightforward. KYAML can make some syntax hazards less likely and the structure more explicit. In return, the team may need to update editor guidance, formatting rules, tests, and conventions, or support a period of mixed formats. I would not pay that cost just because the format is stable. I would pay it when a tested workflow shows the safety benefit is meaningful and the surrounding tools can support the choice consistently.

    Drafted with AI assistance, reviewed and edited by Ali.