---
title: "How to Pretty-Print Your Kubernetes YAML as KYAML and Why You'd Want To"
description: "KYAML is a strict, flow-style subset of YAML introduced by SIG CLI (KEP 5295) for Kubernetes manifests."
url: "https://swe.quest/articles/how-to-pretty-print-your-kubernetes-yaml-as-kyaml-and-why-you-d-want-to-d5e3da195ff638e2"
canonical: "https://kubernetes.io/blog/2026/08/11/how-to-pretty-print-kubernetes-yaml-as-kyaml/"
source: "Kubernetes Blog"
published: "2026-08-11"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["kubernetes","configuration","developer-tools"]
---

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

A post on [Kubernetes Blog](https://swe.quest/sources/kubernetes.md), published 2026-08-11, 5 min read, How-to. Original: [https://kubernetes.io/blog/2026/08/11/how-to-pretty-print-kubernetes-yaml-as-kyaml/](https://kubernetes.io/blog/2026/08/11/how-to-pretty-print-kubernetes-yaml-as-kyaml/)

## Summary

KYAML is a strict, flow-style subset of YAML introduced by SIG CLI (KEP 5295) for Kubernetes manifests. It avoids whitespace-dependent structure and silent type coercion such as the "Norway bug" by always quoting string values and using braces for maps and brackets for lists. Unlike JSON, it allows comments and trailing commas. Because every KYAML file is valid YAML, existing tools and any kubectl version can consume it. KYAML output is available via \`kubectl -o kyaml\` (alpha in 1.34, beta in 1.35, with kuberc to set it as the default), sigs.k8s.io/yaml's yamlfmt, and Google's yamlfmt kyaml formatter (v0.21.0+), which also works in pre-commit hooks and CI.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)
- [Configuration management](https://swe.quest/tags/configuration.md) (Reliability & operations)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Kubernetes manifests ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- YAML syntax

## Keywords

KYAML, kubectl, YAML, KEP 5295, yamlfmt, kuberc, sigs.k8s.io/yaml

## Related posts

- [Kafka App? There’s a Skill for That](https://swe.quest/articles/kafka-app-there-s-a-skill-for-that-db613ac72530c591.md): Etsy Code as Craft · 2026-07-31 · Medium · 6 min read · AI agents, AI for coding, Stream processing, Developer productivity, Queues & messaging
  Etsy's streaming platform team built Agent Skills that let coding agents like Claude scaffold, validate, run locally and open PRs for Kafka streaming apps that produce ML features and embeddings.
- [Kubernetes v1.37: Metrics API graduates to stable](https://swe.quest/articles/kubernetes-v1-37-metrics-api-graduates-to-stable-9cf296727e7fc487.md): Kubernetes Blog · 2026-08-27 · Medium · 2 min read · Kubernetes, Observability, API design
  Kubernetes v1.37 graduates the metrics.k8s.io resource Metrics API, which supplies node and Pod CPU and memory usage to kubectl top and the HorizontalPodAutoscaler, to stable v1.
- [How we use Kotlin for backend services at Zalando](https://swe.quest/articles/how-we-use-kotlin-for-backend-services-at-zalando-86a4c360d01f2393.md): Zalando Engineering · 2021-06-30 · Easy · 4 min read · Java & JVM, Engineering culture, API design
  Zalando moved Kotlin from TRIAL to ADOPT on its Tech Radar, making it the third supported JVM language alongside Java and Scala after 100+ new Kotlin applications were written in a year.
- [How we build containerized services at GitHub using GitHub](https://swe.quest/articles/how-we-build-containerized-services-at-github-using-github-fb75069d884e4f71.md): GitHub Engineering · 2023-08-02 · Easy · 6 min read · Kubernetes, Developer productivity, Deployment, Containers, CI/CD
  GitHub runs hundreds of internal and production services on a "paved path": a Kubernetes-based, multi-cluster, multi-region platform plus conventions and custom tooling layered on top.
- [Our journey taking Kubernetes state metrics to the next level](https://swe.quest/articles/our-journey-taking-kubernetes-state-metrics-to-the-next-level-53c89d582db9c1aa.md): Datadog Engineering · 2021-10-15 · Medium · 12 min read · Kubernetes, Observability, Go, Performance engineering, Open source
  Datadog's Containers team made kube-state-metrics usable as a library: an upstream PR made the KSM Builder extensible so the MetricStore could be swapped out, with neutral-to-slightly-better benchmark results.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
