Skip to content
Latchkey

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   # validate

In 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →