पाठ 9 / 25

Rendering, Linting and Dry Runs

Inspect the YAML Helm will produce before it reaches a cluster.

See the output before you apply it

Most chart bugs are visible in the rendered YAML, so make rendering a habit. helm template renders a chart locally and prints manifests without contacting the cluster; it is ideal for reviews, CI checks and diffing. Note that it does not know the cluster's real state: lookup returns nothing and .Capabilities uses defaults unless you pass --kube-version or --api-versions. helm install or upgrade with --dry-run renders and validates against the cluster without changing it (--dry-run=server also lets lookup query the cluster). helm lint checks chart structure and common mistakes. Adding --debug prints rendered output even when it fails to parse, which helps locate a broken template. The helm-diff plugin (helm diff upgrade) shows exactly what an upgrade would change in a live release.

Render, lint and diff

Run these locally and in CI before any upgrade.

helm lint ./charts/shop-api -f values-prod.yaml

helm template shop-api ./charts/shop-api -f values-prod.yaml \
  --namespace shop > rendered.yaml

# render only one template while debugging
helm template shop-api ./charts/shop-api -s templates/deployment.yaml --debug

# against a live cluster, no changes applied
helm upgrade --install shop-api ./charts/shop-api -n shop -f values-prod.yaml --dry-run=server

# with the helm-diff plugin installed
helm diff upgrade shop-api ./charts/shop-api -n shop -f values-prod.yaml

Read the rendered YAML in review

Reviewing template diffs is hard; reviewing rendered manifests is easy. Many teams commit or attach helm template output per environment to pull requests so reviewers see what will actually change.

त्वरित जाँच: Which command renders manifests locally without contacting the cluster?

  • helm upgrade --wait
  • helm rollback
  • helm template
  • helm status
Answer

helm template — helm template renders charts offline; dry runs of install/upgrade can contact the cluster.