Master Helm: The Ultimate Guide to Kubernetes Package Management
This comprehensive tutorial explains Helm's core concepts, workflow, differences between Helm 2 and Helm 3, step‑by‑step installation, repository management, chart creation, customization, packaging, deployment, upgrade, rollback, and how to push charts to a Harbor repository, providing practical commands and examples for Kubernetes administrators and developers.
Helm – Kubernetes Package Management Tool
Table of Contents
1. Concepts
1.1 Helm Core Concepts
Chart : A Helm chart is a package that contains a set of YAML files defining Kubernetes resources. It acts as a template for deploying an application.
Repository : A storage location for charts. Each repository has an index file listing available charts and versions.
Release : An instance of a chart deployed in a cluster. Multiple releases can be created from the same chart, each with its own configuration and status.
The official Helm website provides installation guides, documentation, chart repositories, and community contributions.
1.2 Helm Workflow
Find Chart : Search for the desired chart in a repository.
Install Chart : Use helm install to create a release.
Manage Release : Use helm upgrade, helm rollback, helm uninstall, etc.
Maintain Repository : Add, update, or delete repositories.
1.3 Helm 2 vs Helm 3
Helm 2 : Uses a client‑server model with a Tiller component running in the cluster.
Helm 3 : Removes Tiller; the client talks directly to the Kubernetes API server, simplifying architecture and improving security.
Server‑side Tiller removed.
Release names can be reused across namespaces.
Charts can be pushed to Docker registries.
JSONSchema validation for values.
2. Helm Deployment
2.1 Install Helm
2.1.1 Download Helm client
Visit the Helm GitHub releases page (e.g., https://github.com/helm/helm/releases ) and download the appropriate tarball for your OS.
2.1.2 Install Helm
tar -zxvf helm-v3.6.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm2.1.3 Verify installation
# Run helm version to check the installation
helm version2.1.4 Enable command completion
# Add completion to bash profile
echo "source <(helm completion bash)" >> ~/.bashrc2.2 Use Helm to Install a Chart
2.2.1 Add repositories
# Add common Helm repositories
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add stable http://mirror.azure.cn/kubernetes/charts
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo add incubator https://charts.helm.sh/incubator2.2.2 Update repositories
# Refresh the repository index
helm repo update2.2.3 List repositories
helm repo list2.2.4 Remove a repository
# Remove the incubator repo
helm repo remove incubator2.2.5 Show chart information
# Show chart metadata
helm show chart stable/mysql
# Show all details
helm show all stable/mysql2.2.6 Install a chart
# Install with a custom release name
helm install my-redis bitnami/redis -n default
# Or let Helm generate a name
helm install bitnami/redis --generate-name2.2.7 List releases
# List all releases
helm ls
helm list2.2.8 Check release status
# Show status of a release
helm status my-redis2.2.9 Uninstall a release
# Delete a release
helm uninstall my-redis3. Helm Chart Custom Templates
3.1 View chart file details
Charts can be downloaded from a repository or created locally. A chart consists of Chart.yaml, values.yaml, and a templates directory containing Kubernetes manifests.
3.2 Pull a chart
mkdir /opt/helm
cd /opt/helm
helm pull stable/mysql
ls
# Output: mysql-1.6.9.tgz3.3 Inspect chart structure
tar xf mysql-1.6.9.tgz
tree mysql
# Shows Chart.yaml, README.md, templates/, values.yaml, etc.3.4 Chart structure details
Chart.yaml : Metadata such as name, version, description.
templates : Go‑template files for Deployments, Services, ConfigMaps, Ingress, etc.
values.yaml : Default configuration values.
NOTES.txt : Post‑install messages.
3.5 Create a custom chart
3.5.1 Create chart skeleton
helm create nginx
# Generates a directory with Chart.yaml, values.yaml, and templates/3.5.2 Modify Chart.yaml and values.yaml
# Edit Chart.yaml to set name, version, description, etc.
# Edit values.yaml to change replicaCount, image repository, service type, ingress settings, resources, etc.3.5.3 Lint, package, and install
helm lint nginx
helm package nginx # Produces nginx-0.1.0.tgz
helm install nginx ./nginx --dry-run --debug # Validate without installing
helm install nginx ./nginx -n default # Real installation3.5.4 Deploy Ingress‑Nginx
wget https://gitee.com/mirrors/ingress-nginx/raw/nginx-0.30.0/deploy/static/mandatory.yaml
wget https://gitee.com/mirrors/ingress-nginx/raw/nginx-0.30.0/deploy/static/provider/baremetal/service-nodeport.yaml
kubectl apply -f mandatory.yaml
kubectl apply -f service-nodeport.yaml
# Add host entry and test with curl3.5.5 Upgrade a chart
# Change service type to NodePort in values.yaml
helm upgrade nginx nginx4. Rollback
4.1 View release history
helm history nginx4.2 Perform rollback
helm rollback nginx 1 # Roll back to revision 1
helm history nginx # Verify the rollback4.3 Maintain chart files
Update Chart.yaml for metadata and values.yaml for configuration changes.
4.4 Use --set for quick overrides
# Override image tag without editing values.yaml
helm upgrade nginx nginx --set image.tag='1.15'Helm offers flexible management of Kubernetes applications, with rollback, --set overrides, and powerful templating.
5. Helm Repository (Harbor)
5.1 Install Harbor
# Extract offline installer and configure harbor.yml (hostname, admin password, data volume, etc.)
./install.sh --with-clair --with-chartmuseum # Enable Clair and ChartMuseum services5.2 Install Helm Push plugin
# Online installation
helm plugin install https://github.com/chartmuseum/helm-push
# Offline installation (extract tarball into ~/.local/share/helm/plugins/helm-push)5.3 Configure Helm repository
helm repo add harbor http://192.168.241.24/chartrepo/chart_repo --username=admin --password=Harbor123455.4 Push chart to Harbor
cd /opt/
helm push nginx harborAfter pushing, the chart appears in Harbor's chart_repo project.
6. Summary
6.1 Helm command cheat sheet
Command
Description
Completion
Enable command completion
Create
Create a new chart
Dependency
Manage chart dependencies
Env
Show Helm environment
Get
Retrieve extended release information
Help
Show help for a command
History
Show release revision history
Install
Deploy a chart
Lint
Validate chart syntax
List (ls)
List releases
Package
Package a chart into a tgz
Plugin
Manage Helm plugins
Repo
Add, list, remove, update repositories
Rollback
Rollback a release to a previous revision
Search
Search for charts
Show
Display chart information
Status
Show release status
Template
Render templates locally
Test
Run chart tests
Uninstall
Delete a release
Upgrade
Upgrade a release
Verify
Verify chart signatures
Version
Show Helm version
These commands cover the full lifecycle of Helm chart development, deployment, and management in Kubernetes environments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
