Charts for a platform · wrap-up
Cheat sheet & self-check
Every command from this section on one page.
Library chart workflow
type: library | In the library's Chart.yaml: templates only, nothing rendered on its own |
dependencies: [ { name: platform-lib, version: 1.2.0, repository: oci://registry/charts } ] | In the service chart's Chart.yaml |
helm dependency update ./orders | Fetch dependencies, write Chart.lock |
helm template orders ./orders | Render the service with the library's defaults |
helm lint ./orders | Lint the result |
CRDs
helm install … --skip-crds | Install without the chart's crds/ folder (CRDs managed elsewhere) |
kubectl apply --server-side -f crds/ | Install or upgrade CRDs yourself (large CRDs need server-side apply) |
kubectl get crd <name> -o jsonpath='{.spec.versions[*].name}' | Which API versions a CRD serves |
Hooks
helm.sh/hook: pre-upgrade | Run this resource before the upgrade's manifests are applied |
helm.sh/hook-weight: "-5" | Order among hooks (lower first) |
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | Clean up hook resources |
helm test orders -n shop | Run the chart's test hooks |
Test pipeline
helm lint ./orders --strict | Chart structure and template problems |
helm template orders ./orders -f ci/prod-values.yaml > rendered.yaml | Render with realistic values |
kubeconform -strict -summary rendered.yaml | Validate against Kubernetes schemas (add CRD schemas for custom kinds) |
helm unittest ./orders | Run unit tests in tests/*_test.yaml (helm-unittest plugin) |
kyverno apply policies/ --resource rendered.yaml | Check rendered output against platform policies |
ct lint --charts ./orders && ct install --charts ./orders | chart-testing: lint, version bump check, install on a cluster |