Test and Lint Helm Charts
Intermediate12 min
Validate chart structure, lint templates, run test pods, and catch errors before deploying charts to production clusters.
Prerequisites
- -Helm 3 installed
- -A Helm chart to test
Steps
1
Lint the chart for errors
Check the chart for common issues and best-practice violations.
$ helm lint myapp/ --strict
The --strict flag treats warnings as errors, useful for CI pipelines.
2
Render templates without installing
Generate the Kubernetes manifests to verify template rendering.
$ helm template test-release myapp/ -f values-production.yaml --validate
The --validate flag requires a connection to a Kubernetes cluster to validate resource schemas.
3
Dry-run against the cluster API
Simulate an install to catch server-side validation errors.
$ helm install test-release myapp/ --dry-run --debug --namespace test
4
Run chart tests
Execute test pods defined in the chart's templates/tests/ directory.
$ helm test my-release --namespace production --timeout 5m
Chart tests are Pods with the 'helm.sh/hook: test' annotation. They run to completion and report pass/fail.
5
Validate with kubeconform
Check rendered manifests against Kubernetes JSON schemas.
$ helm template myapp/ | kubeconform -strict -summary -output json
Full Script
FAQ
Discussion
Loading comments...