Helm Values Formatter

Normalise values.yaml — consistent indentation, sorted keys, no tabs.

values.yaml
Formatted
Send output to

The file every chart argument is really about

A chart's values.yaml is its public interface. It is also, typically, the least disciplined file in the repository: indentation drifts as people add blocks, keys get added in whatever order they were thought of, and after a few contributors the diff on any change touches more than it should.

Tabs

YAML forbids tab characters for indentation, full stop. An editor configured to insert tabs produces a file that looks perfectly aligned and fails to parse with an error that points at the wrong place. Because the character is invisible, this can cost an afternoon. Tabs are found here and reported with their line number before anything else runs.

Duplicate keys

A duplicated key is legal enough for most parsers to accept — the last occurrence silently wins. In a 400-line values file assembled by several people, this is genuinely hard to spot by eye, and the symptom is a setting that visibly exists in the file and has no effect. Every duplicate is reported with both line numbers.

Quoting

The YAML type coercion rules bite hardest in Helm values, because so many values are version numbers and identifiers:

  • version: 1.10 becomes the number 1.1 — the trailing zero is gone.
  • enabled: no becomes boolean false, which is usually intended, and country: NO also becomes false, which is not.
  • tag: 1.2.3 is a string, but tag: 1.2 is a number, so the same field changes type between releases.

Anything that would be re-read as the wrong type is quoted on output, which makes the file mean what it looks like it means.

Sorting is optional on purpose

Alphabetical keys make diffs stable and reviews faster, which is a real win on a large values file. But many charts group keys deliberately — image settings together, resources together — and sorting scatters that grouping. It is a toggle rather than a default because the right answer depends on the chart.

Local only

Values files contain registry credentials often enough that pasting one into a remote formatter is a genuine incident risk. Everything here runs in the page.

Questions people actually ask

Why does Helm reject my file over a tab character?
YAML forbids tabs for indentation outright. An editor that silently inserts one produces a file that looks fine and fails to parse. The formatter finds them and converts them to spaces.
Should I sort keys alphabetically?
It makes diffs stable and reviews easier on a large values file. It is optional here because some charts group keys deliberately, and sorting would scatter that grouping.
Does it detect duplicate keys?
Yes. A duplicate key is legal enough to parse — the last one silently wins — which makes it one of the harder Helm bugs to spot by eye. It is reported with both line numbers.
navigate open esc close