Helm Charts
Helm is the package manager for Kubernetes. Charts are reusable, parameterized packages of Kubernetes manifests. Helm simplifies deploying complex applications, managing releases, and handling upgrades and rollbacks.
What is Helm?
Helm is often called the "apt/yum for Kubernetes." It solves the problem of managing complex Kubernetes applications that require dozens of YAML manifests.
Without Helm, deploying a production application means managing separate YAML files for Deployments, Services, ConfigMaps, Secrets, Ingress, HPA, PodDisruptionBudgets, etc. — and customizing them for each environment (dev, staging, prod).
Helm introduces three key concepts: - Chart — A package of pre-configured Kubernetes resources (like a .deb or .rpm package) - Release — A deployed instance of a chart in a cluster - Repository — A place to store and share charts (e.g., apt repositories)
Helm Chart Structure
A Helm chart is a directory with a specific structure:
mychart/
Chart.yaml # Chart metadata (name, version, description)
values.yaml # Default configuration values
charts/ # Dependency charts (subcharts)
templates/ # Kubernetes manifest templates
deployment.yaml
service.yaml
ingress.yaml
configmap.yaml
_helpers.tpl # Template helper functions (not rendered directly)
NOTES.txt # Post-install instructions shown to user
.helmignore # Files to ignore when packagingChart.yaml and values.yaml
The two most important files in a chart:
# Chart.yaml - Chart metadata
apiVersion: v2
name: web-app
description: A production-ready web application chart
type: application
version: 1.2.0 # Chart version (semver)
appVersion: "2.1.0" # Application version being packaged
keywords:
- web
- nodejs
maintainers:
- name: DevOps Team
email: devops@company.com
---
# values.yaml - Default values (overridable at install time)
replicaCount: 2
image:
repository: myrepo/web-app
tag: "2.1.0"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
targetPort: 3000
ingress:
enabled: false
host: ""
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi
autoscaling:
enabled: false
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
env:
NODE_ENV: production
LOG_LEVEL: infoWriting Helm Templates
Helm templates use the Go template language with Helm-specific functions. Values from values.yaml are injected using the .Values object:
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "web-app.fullname" . }}
labels:
{{- include "web-app.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "web-app.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "web-app.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.targetPort }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- if .Values.autoscaling.enabled }}
# HPA is enabled, no static replicas
{{- end }}Helm CLI: Installing and Managing Releases
The Helm CLI manages the full lifecycle of chart releases:
# ---- Add repositories ----
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
# ---- Search for charts ----
helm search repo nginx
helm search hub postgresql
# ---- Install a chart ----
helm install my-release ./mychart # From local chart
helm install my-release bitnami/postgresql # From repo
helm install my-release ./mychart -f values.prod.yaml # Custom values file
helm install my-release ./mychart --set replicaCount=3 --set image.tag=2.2.0 --namespace production --create-namespace
# ---- Upgrade a release ----
helm upgrade my-release ./mychart --set image.tag=2.3.0
helm upgrade --install my-release ./mychart # Install if not exists
# ---- Rollback ----
helm history my-release # View release history
helm rollback my-release 2 # Rollback to revision 2
# ---- Inspect and debug ----
helm list -A # List all releases
helm status my-release # Release status
helm get values my-release # Values used for release
helm template ./mychart # Render templates locally (debug)
helm lint ./mychart # Validate chart
# ---- Uninstall ----
helm uninstall my-releaseKey Takeaways
- Helm is the Kubernetes package manager — charts bundle all manifests for an application into a reusable package.
- values.yaml provides defaults; override with -f values.prod.yaml or --set key=value at install time.
- Helm tracks releases and supports rollback to any previous revision.
- Use helm template to render manifests locally for debugging without deploying.
- Helm repositories (Artifact Hub, Bitnami) provide production-ready charts for common software.
Contact Us
Have a question or feedback? Fill out the form below or reach us directly at support@nvaitraining.com