Skip to main content

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

EcosystemPackage Manager
Linux (Debian)apt
Linux (RedHat)yum/dnf
macOSHomebrew
Node.jsnpm
Pythonpip
KubernetesHelm

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

AspectHelm 2Helm 3
ArchitectureClient + Tiller (server)Client only
SecurityRBAC issues with TillerUses kubectl credentials
Release storageConfigMaps (by Tiller)Secrets (release namespace)
CRDsLimited managementNative support
3-way mergeNoYes

3-way merge

Helm 3 compares three states during an upgrade:

  1. Current state in the cluster
  2. State of the previous release
  3. 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.

RepositoryURLSpecialty
Bitnamicharts.bitnami.com/bitnamiGeneral applications
Prometheusprometheus-community.github.io/helm-chartsMonitoring
Grafanagrafana.github.io/helm-chartsDashboards
Jetstackcharts.jetstack.iocert-manager
Ingress NGINXkubernetes.github.io/ingress-nginxIngress

5.3 Complementary tools

ToolDescription
HelmfileDeclarative deployment of multiple charts
helm-diffPlugin to view differences before upgrade
helm-secretsPlugin to manage encrypted secrets
chart-testingChart 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.

→ Next chapter: Installation


← Back to the table of contents