Linting and Validating Charts
1. Linting Chart Templates
2. Checking Chart Structure
| Check | Detail |
|---|---|
| Chart.yaml present + valid | Required fields filled |
| values.yaml parses | Valid YAML |
| Templates render | No syntax errors |
| Schema check | If values.schema.json present |
| Icon URL reachable | HTTPS recommended |
3. Validating Chart.yaml
| Field | Lint check |
|---|---|
apiVersion | Must be v2 (Helm 3) |
name | DNS-1123 label |
version | SemVer compliant |
icon | HTTPS URL if present |
4. Validating Template Syntax
5. Using Strict Linting
| Flag | Effect |
|---|---|
--strict | Treat warnings as errors (exit non-zero) |
--quiet | Print only errors |
6. Checking Values Schema
Example: Schema-enforced lint
helm lint ./chart -f bad-values.yaml
# Error: values don't meet the specifications of the schema(s) in the following chart(s)
7. Validating Kubernetes Resources
| Tool | Purpose |
|---|---|
kubeconform | Offline schema validation against K8s OpenAPI |
kubeval | Older alternative (archived) |
kubectl apply --dry-run=server | Live admission webhook validation |
polaris / kube-linter | Best-practices linting |
8. Generating Dry-Run Output
| Command | Use |
|---|---|
helm install x ./chart --dry-run --debug | Pre-install validation |
helm upgrade x ./chart --dry-run | Diff intent before applying |
--dry-run=server | Run through admission controllers |
9. Using Template Command
Example: Render without cluster
helm template myrelease ./chart \
-f values.yaml \
--namespace web \
--api-versions monitoring.coreos.com/v1 \
--kube-version 1.29.0 \
--show-only templates/deployment.yaml
10. Debugging Template Rendering
| Flag | Effect |
|---|---|
--debug | Print computed values + stack trace on error |
--disable-openapi-validation | Skip OpenAPI schema check |
--show-only path | Render single template file |
11. Validating Dependencies
| Command | Use |
|---|---|
helm dependency list | Verify all dependencies resolved |
helm dependency update | Re-download per Chart.yaml |
helm dependency build | Lock-file-driven install |