⎈ k8s knowledge compiler

KYAML Reference [page]deterministic

reference

KYAML is a safer and less ambiguous subset of YAML, initially introduced in Kubernetes v1.34 (alpha) and enabled by default in v1.35 (beta). Designed specifically for Kubernetes, KYAML addresses common YAML pitfalls such as whitespace sensitivity and implicit type coercion while maintaining full compatibility with existing YAML parsers and tooling.

This reference describes KYAML syntax.

## Getting started with KYAML

YAML’s reliance on indentation and implicit type coercion often leads to configuration errors, especially in CI/CD pipelines and templating systems like Helm. KYAML eliminates these issues by enforcing explicit syntax and structure, making configurations more reliable and easier to debug.

### Basic Structure

KYAML uses *flow style* syntax with `{}` for objects and `[]` for arrays. All string values must be double-quoted.

```yaml --- { apiVersion: "v1", kind: "Pod", metadata: { name: "my-pod", labels: { app: "demo" }, }, spec: { containers: [{ name: "nginx", image: "nginx:1.20" }] } } ```

Sources

reference/encodings/kyaml.md · docKYAML Reference

Related (2)

part_of Getting started with KYAMLdescribes conf=1
part_of Basic Structuredescribes conf=1

← all Docs