Helm
Website: https://helm.sh CLI Tool: helm Authentication: Kubernetes cluster credentials
Description
Helm is the package manager for Kubernetes. It helps you define, install, and upgrade Kubernetes applications using charts. Charts are packages of pre-configured Kubernetes resources. Essential for managing complex Kubernetes applications and deployments.
Commands
Chart Management
Search Charts
helm search hub <keyword>
helm search repo <keyword>
helm search repo nginx
helm search hub wordpress
Search for charts in Hub or repositories.
Show Chart Info
helm show chart <chart>
helm show values <chart>
helm show readme <chart>
helm show all <chart>
Display information about a chart.
Pull Chart
helm pull <chart>
helm pull <chart> --untar
helm pull <chart> --version 1.2.3
helm fetch <chart>
Download chart to local directory.
Create Chart
helm create <name>
helm create my-app
Create new chart with starter files.
Lint Chart
helm lint <path>
helm lint ./my-chart
Validate chart for issues.
Package Chart
helm package <path>
helm package ./my-chart
helm package ./my-chart --version 1.0.0
Package chart into archive file.
Dependency Management
helm dependency list <chart>
helm dependency update <chart>
helm dependency build <chart>
Manage chart dependencies.
Repository Management
Add Repository
helm repo add <name> <url>
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami
Add chart repository.
List Repositories
helm repo list
List configured repositories.
Update Repositories
helm repo update
helm repo update <name>
Update local repository cache.
Remove Repository
helm repo remove <name>
helm repo remove stable
Remove repository from configuration.
Release Management
Install Release
helm install <name> <chart>
helm install my-release bitnami/nginx
helm install my-app ./my-chart
helm install my-app ./my-chart --values values.yaml
helm install my-app ./my-chart --set key=value
Install chart as new release.
Install with Namespace
helm install <name> <chart> --namespace <ns>
helm install my-app ./chart --namespace production
helm install my-app ./chart --namespace prod --create-namespace
Install in specific namespace.
Dry Run
helm install <name> <chart> --dry-run --debug
helm install my-app ./chart --dry-run --debug > output.yaml
Test installation without applying.
Generate Name
helm install <chart> --generate-name
helm install bitnami/mysql --generate-name
Auto-generate release name.
List Releases
helm list
helm list --namespace <ns>
helm list --all-namespaces
helm list -A
List installed releases.
Get Release Info
helm get all <release>
helm get values <release>
helm get manifest <release>
helm get notes <release>
helm get hooks <release>
Get details about a release.
Status
helm status <release>
helm status my-release
helm status my-release --namespace production
Show status of release.
Upgrade Release
helm upgrade <release> <chart>
helm upgrade my-release bitnami/nginx
helm upgrade my-release ./chart --values values.yaml
helm upgrade my-release ./chart --set image.tag=2.0
Upgrade existing release.
Upgrade or Install
helm upgrade --install <release> <chart>
helm upgrade --install my-app ./chart
Install if not exists, upgrade if exists.
Rollback Release
helm rollback <release>
helm rollback <release> <revision>
helm rollback my-release 1
Rollback to previous or specific revision.
Uninstall Release
helm uninstall <release>
helm uninstall my-release
helm uninstall my-release --namespace production
helm delete <release>
Uninstall release and delete resources.
Keep History
helm uninstall <release> --keep-history
Uninstall but keep release history.
History and Revisions
Release History
helm history <release>
helm history my-release
helm history my-release --max 10
Show release revision history.
Get Revision
helm get values <release> --revision <num>
helm get manifest <release> --revision 2
Get specific revision details.
Templates
Template Rendering
helm template <name> <chart>
helm template my-app ./chart
helm template my-app ./chart --values values.yaml
helm template my-app ./chart --set key=value
Render templates locally without installing.
Show Template Output
helm template <name> <chart> --debug
helm template <name> <chart> --show-only templates/deployment.yaml
Debug or show specific templates.
Testing
Test Release
helm test <release>
helm test my-release
helm test my-release --logs
Run tests for a release.
Plugin Management
List Plugins
helm plugin list
List installed plugins.
Install Plugin
helm plugin install <url>
helm plugin install https://github.com/databus23/helm-diff
Install Helm plugin.
Update Plugin
helm plugin update <name>
Update plugin to latest version.
Uninstall Plugin
helm plugin uninstall <name>
Remove plugin.
Environment and Configuration
Show Environment
helm env
Display Helm environment information.
Version
helm version
helm version --short
Show Helm version.
Completion
helm completion bash
helm completion zsh
helm completion fish
Generate shell completion scripts.
Advanced Options
Wait for Resources
helm install <name> <chart> --wait
helm install <name> <chart> --wait --timeout 10m
helm upgrade <name> <chart> --wait
Wait until resources are ready.
Atomic Install
helm install <name> <chart> --atomic
helm upgrade <name> <chart> --atomic
Rollback on failure.
Force Upgrade
helm upgrade <name> <chart> --force
helm upgrade <name> <chart> --recreate-pods
Force resource updates.
Cleanup on Fail
helm install <name> <chart> --cleanup-on-fail
Delete resources if installation fails.
Verify
helm install <name> <chart> --verify
helm pull <chart> --verify
Verify package signature.
Examples
Basic Workflows
# Add repository and install chart
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-nginx bitnami/nginx
# Install with custom values
helm install my-app ./my-chart \
--values prod-values.yaml \
--set replicaCount=3 \
--set image.tag=v2.0
# Upgrade release
helm upgrade my-app ./my-chart \
--values prod-values.yaml \
--set image.tag=v2.1 \
--wait
# Check status and history
helm status my-app
helm history my-app
# Rollback if needed
helm rollback my-app 1
Development Workflow
# Create new chart
helm create my-app
# Edit chart files
# - Chart.yaml
# - values.yaml
# - templates/
# Validate chart
helm lint my-app
# Test rendering
helm template my-release ./my-app --debug
# Dry run install
helm install my-release ./my-app --dry-run --debug
# Install for real
helm install my-release ./my-app --namespace dev --create-namespace
# Test the release
helm test my-release
Production Deployment
# Install with production values
helm upgrade --install my-app ./my-chart \
--namespace production \
--create-namespace \
--values values-prod.yaml \
--set image.tag=1.2.3 \
--wait \
--timeout 10m \
--atomic
# Verify deployment
helm status my-app -n production
kubectl get pods -n production
# View release values
helm get values my-app -n production
Managing Multiple Environments
# Development
helm upgrade --install my-app ./chart \
--namespace dev \
--values values.yaml \
--values values-dev.yaml
# Staging
helm upgrade --install my-app ./chart \
--namespace staging \
--values values.yaml \
--values values-staging.yaml
# Production
helm upgrade --install my-app ./chart \
--namespace production \
--values values.yaml \
--values values-prod.yaml \
--atomic
Chart Distribution
# Package chart
helm package ./my-chart
# Creates: my-chart-0.1.0.tgz
# Update dependencies
helm dependency update ./my-chart
# Generate index for chart repository
helm repo index .
# Push to repository (with helm-push plugin)
helm plugin install https://github.com/chartmuseum/helm-push
helm cm-push my-chart-0.1.0.tgz my-repo
Debugging
# Dry run with debug
helm install my-app ./chart --dry-run --debug
# Render specific template
helm template my-app ./chart --show-only templates/deployment.yaml
# Get rendered manifests
helm get manifest my-release
# Check values used
helm get values my-release
# View release notes
helm get notes my-release
# Test with verbose output
helm test my-release --logs
Rollback Scenarios
# List history
helm history my-release
# Rollback to previous version
helm rollback my-release
# Rollback to specific revision
helm rollback my-release 3
# Rollback with wait
helm rollback my-release 2 --wait --timeout 5m
Cleanup
# List all releases
helm list --all-namespaces
# Uninstall release
helm uninstall my-release -n production
# Uninstall but keep history
helm uninstall my-release --keep-history
# List uninstalled releases
helm list --uninstalled
# Permanently delete
helm uninstall my-release
Working with Values
# Show default values
helm show values bitnami/nginx
# Save to file
helm show values bitnami/nginx > values.yaml
# Edit values
# vim values.yaml
# Install with custom values
helm install my-nginx bitnami/nginx -f values.yaml
# Override specific values
helm install my-nginx bitnami/nginx \
-f values.yaml \
--set service.type=LoadBalancer \
--set replicaCount=3
Helm Hooks
# Create chart with hooks
# Add to templates/pre-install-job.yaml:
# metadata:
# annotations:
# "helm.sh/hook": pre-install
# "helm.sh/hook-weight": "0"
# "helm.sh/hook-delete-policy": hook-succeeded
# View hooks for release
helm get hooks my-release
# Hooks execute at lifecycle events:
# - pre-install, post-install
# - pre-upgrade, post-upgrade
# - pre-delete, post-delete
# - pre-rollback, post-rollback
Notes
- Charts: Packages of Kubernetes resources (templates + values)
- Releases: Installed instances of charts
- Repositories: Collections of charts (like package repos)
- Values: Configuration parameters for charts
- Templates: Go template files that generate Kubernetes manifests
- Chart.yaml: Chart metadata (name, version, description)
- values.yaml: Default configuration values
- templates/: Directory containing Kubernetes manifest templates
- charts/: Subdirectory for chart dependencies
- Helm 2 vs 3: Helm 3 removed Tiller (server component)
- Release Names: Must be unique within namespace
- Namespaces: Releases are namespace-scoped
- Atomic: Automatically rollback on failure
- Wait: Wait for resources to be ready (Pods, Jobs, etc.)
- Hooks: Special resources that run at specific points in lifecycle
- Values Precedence: CLI --set > -f values.yaml > Chart defaults
- Version: Semantic versioning (MAJOR.MINOR.PATCH)
- Dependencies: Defined in Chart.yaml dependencies section
- Subcharts: Charts within charts/ directory
- Helm Hub: Central repository of charts (ArtifactHub)
- Chart Museum: Self-hosted chart repository
- OCI Registry: Helm 3 supports OCI registries for charts
- Provenance: Signature verification for charts
- Lint: Checks for errors and best practices
- Template Functions: Sprig library + Helm-specific functions
- Named Templates: Reusable template blocks with define/template
- Range: Loop over lists/maps in templates
- If/Else: Conditional logic in templates
- With: Change scope in templates
- Include vs Template: Include allows piping output
- Required: Fail if value not provided
- Fail Fast: Use --atomic for production deployments
- Best Practices:
- Use semantic versioning
- Test with helm lint and dry-run
- Use values.yaml for defaults
- Document values with comments
- Use atomic upgrades in production
- Keep charts simple and focused
- Version control your charts
- Use namespaces for isolation
Comments (0)
Add a Comment
No comments yet. Be the first to comment!