How do you validate rendered manifests against Kubernetes schemas offline?
IntermediateConceptHooks, Tests & Validation
Answer
Render with helm template and pipe into a schema validator such as kubeconform, with CRD schemas for custom kinds:
helm template shop ./shop -f values-prod.yaml --kube-version 1.31 \
| kubeconform -strict -summary -kubernetes-version 1.31.0 \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
-strict rejects unknown fields, catching typos like resource: instead of resources: that Kubernetes would otherwise prune silently (or reject, with server-side field validation).