Skip to content
Why Kubernetes Is Introducing KYAML: A Safer, JSON‑Like YAML Subset
Cloud Native 5 min read

Why Kubernetes Is Introducing KYAML: A Safer, JSON‑Like YAML Subset

Kubernetes 1.34 will debut KYAML, a strict YAML subset that adds JSON‑style rules to reduce indentation errors and quoting ambiguities, aiming to make configuration files more reliable while preserving comments and flexibility for cloud‑native workloads.

Cloud Native Technology Community
Cloud Native Technology Community
Cloud Native Technology Community

YAML is ubiquitous in Kubernetes: NetworkPolicy, Deployment, Helm charts, and more.

Spaces and Quotes: Two Old Problems

YAML is extremely sensitive to spaces; a slight indentation mistake can cause Helm to fail. Optional quotes also create ambiguities, such as the “Norway Problem” where the unquoted country code NO is parsed as the boolean false. Another example shows a programmer named Richard Null whose Last_Name: Null without quotes is interpreted as a null value.

Some suggest switching to JSON, but JSON has its own drawbacks in Kubernetes contexts: no comments, mandatory quotes on all keys, and disallowed trailing commas.

"YAML Doesn't Have to Be This Bad"

The Kubernetes Enhancement Proposal KEP‑5295 aims to extract a reasonable grammar from the overly broad YAML spec and restrict it to Kubernetes use.

KYAML is a strict subset of YAML:

All KYAML files are valid YAML and can be fed directly to kubectl or Helm without extra flags.

String values must use double quotes.

Keys are unquoted unless ambiguity arises.

Objects (maps) use curly braces {}.

Arrays use square brackets [].

The overall style resembles JSON while retaining comments, trailing commas, and not requiring quotes on every key. Most importantly, KYAML no longer enforces strict indentation.

Official example:

$ kubectl get -o kyaml svc hostnames
---
{
  apiVersion: "v1",
  kind: "Service",
  metadata: {
    creationTimestamp: "2025-05-09T21:14:40Z",
    labels: { app: "hostnames" },
    name: "hostnames",
    namespace: "default",
    resourceVersion: "37697",
    uid: "7aad616c-1686-4231-b32e-5ec68a738bba"
  },
  spec: {
    clusterIP: "10.0.162.160",
    clusterIPs: [ "10.0.162.160" ],
    internalTrafficPolicy: "Cluster",
    ipFamilies: [ "IPv4" ],
    ipFamilyPolicy: "SingleStack",
    ports: [{ port: 80, protocol: "TCP", targetPort: 9376 }],
    selector: { app: "hostnames" },
    sessionAffinity: "None",
    type: "ClusterIP"
  },
  status: { loadBalancer: {} }
}

Community Reaction: Love‑Hate

Syntax debates are a traditional developer pastime. A Reddit user remarked, “It’s better than JSON, I understand why it’s stronger than YAML, but I still hate it.” The Go community already has unofficial KYAML parsers, and projects like StrictYAML are watching.

Kubernetes 1.34 is scheduled for an August release; will KYAML become the next cloud‑native standard? Time will tell.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesyamlHelmKYAML
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.