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.

Paste below, or drop a file anywhere on this panel

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.

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. 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.

  2. 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.

  3. 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.

More kubernetes tools

Kubernetes YAML Generator Answer a few questions, get a manifest Kubernetes YAML Validator Is this YAML valid, and where is it wrong? Kubernetes Rollout & Probe Timing Restart loops, capacity dips and stuck drains Kubernetes Service Checker Will this Service have any endpoints? Kubernetes Network Policy Viewer What can reach what, and what just broke Kubernetes Manifest Diff What actually changed Kubernetes Resource Calculator What these manifests actually reserve Kubernetes RBAC Viewer Who can actually do what Kubernetes Deployment Generator See the capacity dip before you deploy Kubernetes Service Generator port, targetPort, and which one you meant Kubernetes StatefulSet Generator Stable names, and volumes that outlive you Kubernetes QoS Class Calculator And where you sit in the eviction order Kubernetes Node Capacity Planner Allocatable is not capacity Kubernetes Max Pods per Node Calculator The ENI limit, not the 110 default Kubernetes Label Selector Tester Which key failed, not just that one did Kubernetes Taint & Toleration Tester Tolerations permit, they do not attract Kubernetes Resource Name Validator RFC 1123 subdomain, label, or 1035 Kubernetes Label & Annotation Validator Why your image tag is not a legal label Kubernetes CrashLoopBackOff Guide The status is a timer, not a cause Kubernetes TLS Certificate Decoder When it expires, and what it covers Kubernetes ServiceAccount Token Decoder Bound or legacy, and when it dies Kubernetes imagePullSecret Generator The registry URL nobody gets right Kubernetes cert-manager Certificates Issuer scope, and the rate limit that costs a week Kubernetes Flux HelmRelease Generator With the source it cannot work without Kubernetes Helm Chart Generator Chart.yaml, values, and working templates Kubernetes Argo CD Application Generator The defaults that are off, turned on Kubernetes Ingress Generator pathType, and the TLS secret that fails quietly Kubernetes HPA Generator Why it says unknown and never scales Kubernetes SecurityContext Generator Pod level, container level, and which wins Kubernetes Probe Generator How long it gets to start before liveness kills it Kubernetes PVC Generator Access modes your storage can actually do Kubernetes ResourceQuota Generator And the LimitRange that stops it breaking deploys Kubernetes CronJob Generator The fields that decide whether it runs Kubernetes NetworkPolicy Generator With the DNS rule already in it Kubernetes RBAC Generator And what it actually grants Kubernetes PodDisruptionBudget Generator Can this budget ever be satisfied? Kubernetes API Deprecation Checker What breaks on the next upgrade Kubernetes Kubeconfig Viewer Read it without handing it to anyone Kubernetes Quantity Parser What 512Mi, 100m and 1e3 actually mean Kubernetes Multi-Document YAML Splitter One file per object, in apply order Kubernetes .env to ConfigMap & Secret Split the credentials out on the way Kubernetes Secret Decoder See what is actually in there Kubernetes Ingress to Gateway API Which annotations silently stop working Kubernetes Manifest Visualizer What points at what, and what points at nothing Kubernetes Patch Tester Which --type, and what it deletes Kubernetes kubectl JSONPath Tester kubectl's dialect, not generic JSONPath Kubernetes Node Affinity Tester Required excludes, preferred only scores Kubernetes Helm Values Diff A missing key is a third value Kubernetes Pod and Service CIDR Fixed at cluster creation Kubernetes Secret Encoder base64 is not encryption Kubernetes API Version Checker Will this apply on that cluster Kubernetes Cluster Cost Estimator At your rates, not a price table Kubernetes Kustomize Build Transformers run in kustomize's order Kubernetes Helm Chart Validator version is SemVer, appVersion is not

Elsewhere on the site