09 - Helm & Package Management
Why this matters
Real applications aren't one YAML file — they're dozens, parameterized per environment. Helm is the de facto package manager for Kubernetes; almost every prod cluster uses it or something like it (Kustomize is the other major option — know both).
Read this first — Definitions & Explanations
Helm
The common package manager for Kubernetes. It templates YAML and installs it as a versioned release.
Chart
A package of templates + default values that describes an application (Deployments, Services, etc.).
values.yaml
Configuration knobs for a chart (image tag, replica count, ingress host). You override values per environment.
Release
An installed instance of a chart in a cluster/namespace (helm install my-app ./chart).
helm upgrade / rollback
- upgrade: apply a new chart version or values
- rollback: return a release to a previous revision
Repository
A place that hosts charts (helm repo add ...).
Why Helm helps
Keeps complex apps maintainable, repeatable, and parameterized instead of copying raw YAML forever.
Official docs (read for detail)
- Helm Docs
- Helm Charts Guide
- Chart Best Practices
- Kubernetes Package Management overview (objects Helm renders)
Key Concepts
- Chart = templated collection of manifests +
values.yaml - Release = a deployed instance of a chart (can install same chart multiple times)
helm install/upgrade/rollback/uninstall- Chart repositories,
Chart.yaml, dependencies (subcharts) - Templating:
{{ .Values.x }},{{ include }},{{ if }}, ranges - Helm vs Kustomize: templating engine vs patch-based overlays — know the tradeoffs
helm diffplugin for safe upgrades,--dry-run/--debug
YouTube search terms
- "Helm charts explained Kubernetes"
- "Helm vs Kustomize"
- "Writing your first Helm chart tutorial"
Hands-on lab (on prod-sim)
# Install something real via Helm
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-nginx bitnami/nginx --set replicaCount=2
helm list
helm status my-nginx
# Upgrade and rollback
helm upgrade my-nginx bitnami/nginx --set replicaCount=4
helm history my-nginx
helm rollback my-nginx 1
# Write your own minimal chart
helm create mychart
# edit mychart/values.yaml: change replicaCount to 2, image.repository to nginx
helm install test-release ./mychart --dry-run --debug # render without applying
helm install test-release ./mychart
kubectl get deployments -l app.kubernetes.io/instance=test-release
helm uninstall test-release
helm uninstall my-nginx
Common mistakes and how to avoid them
- Running
helm upgradewithout previewing the change. Render withhelm template, simulate with--dry-run, or use the helm-diff plugin to compare against the live release before you touch production. - Hard-coding environment values into the chart. Keep the chart generic and put per-environment settings in separate values files.
- Upgrading without
--atomicor a rollback plan. A failed upgrade can leave a half-applied release. Use--atomicto roll back automatically, or know thehelm rollbackrevision you can return to. - Editing released resources by hand. The next
helm upgradecan overwrite or conflict with the manual change. Change values and upgrade instead. - Storing secrets in a values file in Git. Values files are plain text. Pull secrets from an external secret manager or encrypt them with SOPS.
Quick answers
What is the difference between a Helm chart and a release?
A chart is the packaged, templated set of Kubernetes manifests. A release is one installed instance of a chart in a cluster, with its own name and values. You can install the same chart many times as separate releases.
How do you roll back a Helm release?
Run helm history RELEASE to see the revisions, then helm rollback RELEASE REVISION. Helm stores each revision's manifest, so a rollback restores that earlier state as a new revision. Add --atomic to upgrades to roll back automatically on failure.
How can you see what Helm will apply?
Run helm template to render the manifests locally, or helm upgrade --dry-run to simulate against the cluster. The helm-diff plugin shows a line-by-line comparison with the live release, which is the safest check before upgrading production.
Notes
(fill in your own words after watching + labbing)