You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Helm is the package manager for Kubernetes. It simplifies deploying and managing complex applications by packaging Kubernetes manifests into reusable charts with configurable values. This lesson covers Helm concepts, chart creation, templating, hooks, and Helmfile for multi-chart management.
| Concept | Description |
|---|---|
| Chart | A package of Kubernetes resource templates |
| Release | A deployed instance of a chart |
| Values | Configuration overrides for chart templates |
| Repository | A collection of charts (like a package registry) |
| Revision | A versioned snapshot of a release |
┌─────────────┐ ┌─────────────┐ ┌──────────────┐
│ Chart │ + │ Values │ = │ Release │
│ (templates) │ │ (config) │ │ (deployed) │
└─────────────┘ └─────────────┘ └──────────────┘
# Add a chart repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
# Search for charts
helm search repo nginx
helm search hub prometheus
# Install a chart
helm install my-nginx bitnami/nginx --namespace web --create-namespace
# Install with custom values
helm install my-app ./my-chart -f values-production.yaml
# Upgrade a release
helm upgrade my-app ./my-chart -f values-production.yaml
# Install or upgrade (idempotent)
helm upgrade --install my-app ./my-chart -f values-production.yaml
# Roll back to a previous revision
helm rollback my-app 2
# List releases
helm list --all-namespaces
# Uninstall a release
helm uninstall my-app --namespace web
# View release history
helm history my-app
my-chart/
├── Chart.yaml # Chart metadata (name, version, dependencies)
├── values.yaml # Default configuration values
├── templates/
│ ├── _helpers.tpl # Template helper functions
│ ├── deployment.yaml # Deployment template
│ ├── service.yaml # Service template
│ ├── ingress.yaml # Ingress template
│ ├── hpa.yaml # HorizontalPodAutoscaler template
│ ├── configmap.yaml # ConfigMap template
│ ├── secret.yaml # Secret template
│ └── NOTES.txt # Post-install notes
├── charts/ # Dependency charts
└── .helmignore # Files to ignore when packaging
apiVersion: v2
name: my-chart
description: A Helm chart for My Application
type: application
version: 1.2.0 # Chart version
appVersion: "3.1.0" # Application version
dependencies:
- name: postgresql
version: "12.x.x"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
Helm uses Go templates to generate Kubernetes manifests dynamically.
replicaCount: 3
image:
repository: myapp/web-api
tag: "v2.1.0"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
ingress:
enabled: true
host: app.example.com
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
targetCPUUtilization: 70
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.