Helm Charts: the package manager for Kubernetes¶
- It is a tool that simplifies Kubernetes application deployment by bundling its resources (like pods, services, deployments, configmaps, etc.) into a single package called a Helm Chart.
- It automates the process of defining, installing and upgrading Kubernetes applications.
- They are packages for Kubernetes that help you define, install, and manage Kubernetes applications.
But what is it?¶
A helm chart is a collection of files organised in a specific directory structure, which includes:
- chart.yaml: Metadata about the chart (name, version,description)
- values.yaml: defualt configuration values (can be overridden)
- templates/ : Kubernetes manifest templates (in YAML) that Helm renders using values from
values.yaml - NOTES.txt:
optional, provides user instructions after installing the chart
Helm Chart Structure¶
myapp/
├── Chart.yaml
├── values.yaml
├── templates/
│ ├── deployment.yaml
│ ├── service.yaml
│ └── ingress.yaml
└── NOTES.txt
Why use this?¶
- Simpilifies complex Kubernetes deployments
- Supports versioning and rollbacks
- Enables reuse and sharing of charts
- Manages configurations cleanly with
values.yaml
How it Works¶
- Create a Chart: Define Kubernetes resources using templates.
- Install the Chart:
-
Helm takes the templates, substitutes values, and deploys the resources to Kubernetes.
-
Upgrade: Modify values.yaml or templates and upgrade using:
- Rollback: If the upgrade fails:
- Uninstall: To remove an application:
Example: deployment template¶
apiVersion: apps/v1
kind: Deployment
metadata:
name: { { .Release.Name } }
spec:
replicas: { { .Values.replicaCount } }
template:
spec:
containers:
- name: my-container
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"