Introduction to Helm
1 - What is Helm?
Helm is the official package manager for Kubernetes. It lets you define, install, and update complex Kubernetes applications in a reproducible way.
Analogy
| Ecosystem | Package Manager |
|---|---|
| Linux (Debian) | apt |
| Linux (RedHat) | yum/dnf |
| macOS | Homebrew |
| Node.js | npm |
| Python | pip |
| Kubernetes | Helm |
2 - Why use Helm?
The problem without Helm
Deploying an application on Kubernetes often requires several YAML manifests:
mon-application/
├── deployment.yaml
├── service.yaml
├── configmap.yaml
├── secret.yaml
├── ingress.yaml
├── pvc.yaml
├── serviceaccount.yaml
├── role.yaml
└── rolebinding.yaml
Problems encountered:
- Code duplication across environments
- Manual version management
- Hard to share and reuse
- No native rollback mechanism
The solution with Helm
Benefits of Helm:
- 📦 Packaging: Everything in a single package (chart)
- 🔧 Configuration: Values for customization
- 📜 Versioning: Release history
- ⏪ Rollback: Easy return to a previous version
- 🔄 Reproducibility: Same chart = same result
- 🤝 Sharing: Chart repositories
3 - Core concepts
3.1 Chart
A Chart is a Helm package containing all the files needed to deploy an application.
mon-chart/
├── Chart.yaml # Métadonnées du chart
├── values.yaml # Valeurs par défaut
├── templates/ # Templates Kubernetes
│ ├── deployment.yaml
│ ├── service.yaml
│ └── _helpers.tpl
├── charts/ # Charts dépendants
└── README.md
3.2 Release
A Release is an instance of a chart deployed on a cluster.
# Installer un chart crée une release
helm install mon-app ./mon-chart
# Plusieurs releases du même chart
helm install prod-app ./mon-chart --namespace production
helm install staging-app ./mon-chart --namespace staging
3.3 Repository
A Repository is an HTTP server where charts are stored and shared.
# Ajouter un repository
helm repo add bitnami https://charts.bitnami.com/bitnami
# Lister les repositories
helm repo list
# Rechercher des charts
helm search repo nginx
3.4 Values
Values are the configuration parameters of a chart.
# values.yaml
replicaCount: 3
image:
repository: nginx
tag: "1.25"
service:
type: LoadBalancer
port: 80
# Surcharger les values
helm install mon-app ./mon-chart --set replicaCount=5
helm install mon-app ./mon-chart -f production-values.yaml
4 - Helm 3 vs Helm 2
Major evolution
| Aspect | Helm 2 | Helm 3 |
|---|---|---|
| Architecture | Client + Tiller (server) | Client only |
| Security | RBAC issues with Tiller | Uses kubectl credentials |
| Release storage | ConfigMaps (by Tiller) | Secrets (release namespace) |
| CRDs | Limited management | Native support |
| 3-way merge | No | Yes |
3-way merge
Helm 3 compares three states during an upgrade:
- Current state in the cluster
- State of the previous release
- New desired state
This helps preserve manual changes when appropriate.
5 - Helm ecosystem
5.1 Artifact Hub
Artifact Hub is the official public registry for finding Helm charts.
5.2 Popular repositories
| Repository | URL | Specialty |
|---|---|---|
| Bitnami | charts.bitnami.com/bitnami | General applications |
| Prometheus | prometheus-community.github.io/helm-charts | Monitoring |
| Grafana | grafana.github.io/helm-charts | Dashboards |
| Jetstack | charts.jetstack.io | cert-manager |
| Ingress NGINX | kubernetes.github.io/ingress-nginx | Ingress |
5.3 Complementary tools
| Tool | Description |
|---|---|
| Helmfile | Declarative deployment of multiple charts |
| helm-diff | Plugin to view differences before upgrade |
| helm-secrets | Plugin to manage encrypted secrets |
| chart-testing | Chart testing and linting |
6 - Use cases
6.1 Deploy third-party applications
# Installer PostgreSQL
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-postgres bitnami/postgresql
# Installer Prometheus + Grafana
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install monitoring prometheus-community/kube-prometheus-stack
6.2 Standardize internal deployments
# values-production.yaml
replicaCount: 5
resources:
limits:
cpu: 1000m
memory: 1Gi
ingress:
enabled: true
host: app.example.com
# values-staging.yaml
replicaCount: 2
resources:
limits:
cpu: 500m
memory: 512Mi
ingress:
enabled: true
host: app.staging.example.com
6.3 CI/CD and GitOps
7 - Typical workflow
# 1. Trouver un chart
helm search hub wordpress
helm search repo wordpress
# 2. Examiner le chart
helm show readme bitnami/wordpress
helm show values bitnami/wordpress > values.yaml
# 3. Personnaliser
vim values.yaml
# 4. Installer
helm install my-wordpress bitnami/wordpress -f values.yaml
# 5. Vérifier
helm list
kubectl get pods
# 6. Mettre à jour
helm upgrade my-wordpress bitnami/wordpress -f values.yaml
# 7. Rollback si nécessaire
helm rollback my-wordpress 1
# 8. Désinstaller
helm uninstall my-wordpress
Summary
In this chapter, we discovered:
- Helm as the Kubernetes package manager
- The key concepts: Charts, Releases, Repositories, Values
- The evolution from Helm 2 to Helm 3
- The Helm ecosystem and complementary tools
- Typical use cases
Next step
In the next chapter, we will install Helm and configure it.