Skip to content

Category · 2 tools · 1 guide

YAML and configuration tools

Modern infrastructure is mostly configuration. Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Docker Compose files, Ansible playbooks, OpenAPI specs and application settings are all written in YAML, with JSON and TOML close behind. A deploy can fail because of one space of indentation in a file nobody has opened for months.

YAML is popular because it is pleasant to read and write, but it hides traps. Indentation defines structure, tabs are forbidden, unquoted values like no, on or 1.10 change type silently, and anchors can make a file behave differently from how it looks. Error messages from CI runners are often vague, which turns a typo into a long debugging session.

These tools parse your configuration with a real YAML parser, point to the exact line of a problem, normalise formatting and convert between YAML and JSON when another tool only accepts one of them. Config files often contain hostnames and secrets, so they are processed only in your browser.

Tools in this category

Common tasks

Key concepts

Indentation
YAML uses spaces, never tabs, to define nesting. Items at the same level must line up exactly, and list items under a key may be indented or not, but consistently.
Scalars and types
Unquoted values are typed automatically: true, 42, 3.14 and null become booleans, numbers and null. Quote values like "1.10", "yes" or "0755" when you need them as strings.
Multi-document files
A line containing only --- starts a new document. Kubernetes uses this to keep several resources in one file.
Anchors and aliases
&name marks a node and *name reuses it, while <<: *name merges a mapping. They reduce repetition but make files harder to read and are not supported everywhere.
YAML vs JSON
JSON is valid YAML 1.2, so any YAML parser can read JSON. YAML adds comments, multi-line strings and less punctuation, at the cost of more ambiguous parsing.

Best practices

  1. Configure your editor to insert two spaces for indentation in YAML files and to show whitespace.
  2. Quote strings that could be read as another type, such as version numbers, country codes and octal-looking values.
  3. Lint configuration in CI before deploying, so syntax errors fail fast on the pull request.
  4. Keep secrets out of committed config files; reference environment variables or a secret manager instead.
  5. Prefer plain, explicit YAML over clever anchors in shared files so every reader sees the real values.

Guides