Helm ist der Paketmanager für Kubernetes. Im Jahr 2026 wird Helm 3 mit OCI-Unterstützung, verbesserten Lifecycle-Hooks und dem umfangreichen ArtifactHub-Repository zur Standardmethode für die Installation, Aktualisierung und Verwaltung von Kubernetes-Anwendungen. Dieser Leitfaden führt Sie vom ersten Diagramm bis hin zu Helm-Bereitstellungen in Produktionsqualität.
📋 Table of Contents
Warum Helm?
- Paketverwaltung– Installieren Sie komplexe Apps (PostgreSQL, Redis, Prometheus) mit einem Befehl
- Vorlagen– Kubernetes-Manifeste umgebungsübergreifend mit Variablen wiederverwenden
- Release-Management— Sofortiges Rollback auf eine beliebige frühere Version
- Abhängigkeitsmanagement– Diagrammabhängigkeiten deklarieren und verwalten
- ArtifactHub– Über 10.000 Community-Charts für beliebte Anwendungen
Installation
# macOS
brew install helm
# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# Verify
helm version
# Add popular repositories
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
Diagramme installieren
# Search for charts
helm search repo postgres
helm search hub nginx
# Install PostgreSQL
helm install my-postgres bitnami/postgresql --namespace database --create-namespace --set auth.postgresPassword=secretpassword --set primary.persistence.size=20Gi
# Install with custom values file
helm install my-app ./my-chart -f values.prod.yaml
# Check release status
helm list -n database
helm status my-postgres -n database
# Get notes after install
helm get notes my-postgres -n database
# Upgrade release
helm upgrade my-postgres bitnami/postgresql --namespace database --set auth.postgresPassword=newpassword
# Rollback
helm rollback my-postgres 1 # rollback to revision 1
# Uninstall
helm uninstall my-postgres -n database
Erstellen Sie Ihr erstes Diagramm
# Scaffold a new chart
helm create myapp
# Structure:
# myapp/
# Chart.yaml - chart metadata
# values.yaml - default values
# templates/ - Kubernetes manifests (templated)
# deployment.yaml
# service.yaml
# ingress.yaml
# _helpers.tpl - template helpers
# NOTES.txt - post-install notes
# charts/ - dependency charts
# .helmignore
Chart.yaml
apiVersion: v2
name: myapp
description: My production application
type: application
version: 0.1.0 # chart version (semver)
appVersion: "1.2.3" # app version
dependencies:
- name: postgresql
version: "13.x.x"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: redis
version: "17.x.x"
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
Values.yaml – Konfiguration
replicaCount: 2
image:
repository: mycompany/myapp
tag: "1.2.3"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 8000
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: myapp.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: myapp-tls
hosts:
- myapp.example.com
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
postgresql:
enabled: true
auth:
database: myapp_db
existingSecret: myapp-db-secret
redis:
enabled: true
architecture: standalone
Beispiele für Vorlagen
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "myapp.fullname" . }}
labels:
{{- include "myapp.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "myapp.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "myapp.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.port }}
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: myapp-db-secret
key: database-url
- name: APP_VERSION
value: {{ .Chart.AppVersion | quote }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
livenessProbe:
httpGet:
path: /health
port: {{ .Values.service.port }}
initialDelaySeconds: 30
periodSeconds: 10
Mehrere Umgebungen
# values.dev.yaml — development overrides
# helm install myapp ./myapp -f values.yaml -f values.dev.yaml
# values.prod.yaml — production overrides
# helm install myapp ./myapp -f values.yaml -f values.prod.yaml
# values.prod.yaml
replicaCount: 5
image:
tag: "1.2.3-stable"
resources:
limits:
cpu: 2000m
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
autoscaling:
enabled: true
minReplicas: 5
maxReplicas: 50
Helm in CI/CD
# .github/workflows/deploy.yml
- name: Deploy with Helm
run: |
helm upgrade --install myapp ./charts/myapp --namespace production --create-namespace --set image.tag=${{ github.sha }} --set image.repository=ghcr.io/${{ github.repository }} -f values.prod.yaml --wait --timeout 10m --atomic # rollback automatically on failure
Nützliche Helmbefehle
# Lint chart before install
helm lint ./myapp
# Render templates without installing
helm template myapp ./myapp -f values.prod.yaml
# Diff current vs proposed changes
helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade myapp ./myapp -f values.prod.yaml
# Show all values (defaults + overrides)
helm get values myapp -n production --all
# History
helm history myapp -n production
Helm im Jahr 2026 ist für jede Kubernetes-Bereitstellung über einfache Demo-Workloads hinaus unerlässlich. Beginnen Sie mit der Installation von Community-Diagrammen für Abhängigkeiten (PostgreSQL, Redis, Prometheus) und erstellen Sie dann Ihre eigenen Diagramme für Anwendungsbereitstellungen. Das Vorlagensystem macht die Verwaltung mehrerer Umgebungen sauber und reproduzierbar.
🔗 Share this article
✍️ Leave a Comment