Kubernetes Go Template Tester
Render a Helm template against values, in your browser. This is a subset of Go templates plus about forty Sprig functions, and anything it does not implement is named at the line it appeared rather than silently dropped.
.Release, .Chart and .Capabilities are filled with placeholder values, since this page has one template rather than a chart.
Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.
The answer appears here
Paste on the left and press Render. Nothing leaves this tab.
Formatted
Results
Nothing else to flag.
No formatting problems, and nothing the rules object to. Worth remembering what that covers: this reads the file you pasted, not the account or cluster it will be applied to.
No finding matches that filter.
Common mistakes
These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.
Assuming Helm template functions are Go template built-ins
Helm adds roughly sixty Sprig functions plus its own. A template using them works in Helm and fails in kubectl -o go-template, which has only the built-ins.
Instead:Know which engine will run it. This page covers the Sprig subset Helm ships.
Using a dot inside a range without rebinding
Inside range, the dot is the current element, so .Values is no longer reachable.
Instead:Capture it first with $ or assign a variable before the range.
Forgetting whitespace control
A template that renders correct values can still produce invalid YAML through stray blank lines and indentation.
Instead:Use the dash forms, {{- and -}}, and check the rendered output rather than the template.
Go's truthiness is not JavaScript's, and that decides what renders
Go's template package treats an empty map, an empty slice and an empty string as false. A chart guarding `{{ if .Values.resources }}` relies on that, and an engine using JavaScript truthiness renders a block that should have been skipped.
indent and nindent differ by one newline, and it is always the bug
nindent prepends a newline before indenting; indent does not. Almost every chart that renders but produces invalid YAML has one where the other belongs, and the symptom is a block at the wrong indentation rather than an error. This page parses its own output and tells you when the result is not valid YAML, which is the check that catches it.
What is deliberately not implemented
`lookup` queries a live cluster and cannot work here at all: Helm itself returns an empty map for it during `helm template`, so a chart depending on it renders differently under template and install. `tpl` evaluates a string as a template recursively. `.Files` reads the chart's other files. Anything random or clock-based is excluded because its output would differ from the real render every time. Each is reported by name when it appears.
What this cannot see
The rest of the chart. A `_helpers.tpl` can be pasted in below the template that uses it and its defines will resolve, because definitions are registered in a first pass. Anything else it imports is invisible. Check the result against `helm template` before it matters.