helm template: Command Reference for CI/CD
Render a chart to plain YAML, no cluster required.
helm template renders a chart with its values to plain Kubernetes manifests on stdout, entirely client-side. It is how you inspect, diff, and policy-check what a chart will produce before deploying. This reference covers the flags and a CI pattern.
Common flags and usage
- template <release> <chart>: render manifests to stdout
- -f values.yaml / --set k=v: supply the values to render with
- --namespace <ns>: set the namespace used in rendering
- --show-only templates/foo.yaml: render a single template
- --validate: check against the live cluster API (needs access)
Example
shell
helm template web ./charts/web \
-f ./charts/web/values-prod.yaml \
--namespace prod > rendered.yaml
kubectl apply -f rendered.yaml --dry-run=server # validateIn CI
Rendering with helm template and validating the output with kubectl apply --dry-run=server catches both template and schema errors without deploying. Feed rendered.yaml to a policy tool (conftest/kyverno) or to kubectl diff for a review-friendly plan. template alone does not contact the cluster, so it runs anywhere.
Key takeaways
- template renders client-side; it runs without cluster access.
- Pipe the output to --dry-run=server to catch schema errors.
- Rendered YAML feeds policy checks and kubectl diff previews.
Related guides
Helm Cheat Sheet: Charts, Releases & UpgradesA Helm cheat sheet - install, upgrade, rollback, template, repo, and dependency commands for managing Kuberne…
helm lint: Command Reference for CI/CDReference for helm lint: validate a chart for structural and best-practice issues before deploy, strict mode,…
kubectl diff: Command Reference for CI/CDReference for kubectl diff: preview what an apply would change against the live cluster, the meaning of its e…
helm upgrade: Command Reference for CI/CDReference for helm upgrade: update a release or install it if absent with --install, atomic rollback, --wait…