Versioning and Promotion
Versioning and Promotion
Treat the chart as an immutable artifact: bump version for any chart change (semver — chart consumers see breaking changes via major bumps), record the deployed app in appVersion, and promote the exact same chart version through environments rather than rebuilding per environment.
Store the environment definitions next to the chart:
charts/my-api/ # source, tagged v1.4.2
envs/dev/values.yaml
envs/staging/values.yaml
envs/prod/values.yaml
Deployments become deterministic commands:
helm upgrade --install my-api ./charts/my-api -n prod \
-f envs/prod/values.yaml --set image.tag=$TAG --atomic --wait
Because Helm records values per revision, helm get values -n prod my-api shows exactly what a running release was configured with — useful in incident review.
Secrets and Reviews
Secrets and Reviews
Never put credentials in Git plaintext. Two standard patterns:
- SOPS encrypts values.yaml fields with age/PGP — the decrypted file never exists in the repo, and CI decrypts at deploy time.
- Sealed Secrets / external-secrets store only encrypted blobs or reference an external vault.
Before applying anything, diff it:
helm template my-api ./charts/my-api -f envs/prod/values.yaml \
| kubectl diff -f -
Also run helm lint, kubeconform against the rendered output, and a chart/image scanner (e.g. trivy on referenced images) in CI. helm get values and Git history together give an audit trail: what changed, who merged it, what cluster state resulted.
Pitfalls and Interview Angles
Pitfalls and Interview Angles
--set secrets in pipelines. Values passed with --set land in shell history, process listings, and CI logs — use files or external secret stores.
Missing --atomic. An unattended upgrade that half-applies leaves the release broken until a human notices; production upgrades should always carry --atomic --wait.
Chart drift across envs. If dev installs from main and prod from a tag, you are not testing what you ship. Pin --version everywhere.
Drilling rollback. helm history my-api -n prod then helm rollback my-api <revision> -n prod — know the pair cold; verify with kubectl rollout status after rollback.
Interview angle: walk your promotion path (build once, same version dev → staging → prod), the gates between stages, and how you would investigate what values a prod release actually has.
Quiz
1. What should a chart's version field track?
2. How do you see the user-supplied values of a running release?
3. What is the risk of --set DB_PASSWORD=... in a production pipeline?
Flashcards
Question
Chart semver discipline
Click to reveal answer
Answer
version = chart packaging semver, appVersion = app; promote the same immutable chart version across environments.
Question
helm history / rollback
Click to reveal answer
Answer
history lists revisions; rollback <name> <revision> re-applies a stored revision's manifests and values.
Question
SOPS vs Sealed Secrets
Click to reveal answer
Answer
SOPS encrypts fields in-file with age/PGP; Sealed Secrets encrypt values as cluster-decryptable CRs.
Question
Rendered diff gate
Click to reveal answer
Answer
helm template ... | kubectl diff -f - shows the exact API changes before applying.
Revision Notes
Key Takeaways
- 1. Pin chart versions and promote one artifact through all environments
- 2. Keep environment values in Git and secrets encrypted outside it
- 3. lint → template → diff → atomic upgrade, with helm history/rollback as the escape hatch
Interview Tips
- • Lay out the promotion pipeline and the specific gate that catches each class of mistake
- • Show how you would audit a bad prod deploy: helm get values + Git blame + helm history
Cheat Sheet
Semver the chart, promote one version dev→staging→prod; envs/*/values.yaml; SOPS/sealed secrets; CI: lint + template + diff; upgrade --atomic --wait; helm history/rollback to recover.