Cloud Native 18 min read

Master Helm: From Installation to Advanced Chart Management in Kubernetes

This guide provides a comprehensive introduction to Helm, covering its purpose as a Kubernetes package manager, detailed installation steps, repository management, chart creation and structure, deployment commands, debugging techniques, built‑in objects, and practical examples such as deploying MySQL and Nginx with Helm.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Helm: From Installation to Advanced Chart Management in Kubernetes

Helm Overview

Helm is a package manager for Kubernetes, used to manage Charts similarly to yum on Linux.

A Helm Chart bundles a set of YAML files that define a native Kubernetes application and its metadata.

For publishers, Helm packages applications, manages dependencies, versions, and publishes to repositories.

For users, Helm enables simple search, install, upgrade, rollback, and uninstall of applications on Kubernetes.

Installation

[root@k8s-master ~]# tar xvf helm-v3.17.2-linux-amd64.tar.gz
linux-amd64/
linux-amd64/LICENSE
linux-amd64/helm
linux-amd64/README.md
[root@k8s-master ~]# cp -p helm /usr/local/bin/
[root@k8s-master ~]# echo "source <(helm completion bash)" >> ~/.bashrc
[root@k8s-master ~]# source ~/.bashrc
[root@k8s-master ~]# helm version
version.BuildInfo{Version:"v3.17.2", GitCommit:"cc0bbbd6d6276b83880042c1ecb34087e84d41eb", GitTreeState:"clean", GoVersion:"go1.23.7"}

Managing Third‑Party Repositories

Aliyun repository: https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

Bitnami repository: https://charts.bitnami.com/bitnami

Microsoft repository: Index of /kubernetes/charts/

Official repository: https://hub.kubeapps.com/charts/incubator

# Add Aliyun repository
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
"aliyun" has been added to your repositories
# Add Bitnami repository
helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories
# List repositories
helm repo list
NAME    URL
aliyun   https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
bitnami  https://charts.bitnami.com/bitnami
# Search repository
helm search repo aliyun
# Remove repository
helm repo remove aliyun

Using Helm

# Search charts
helm search repo redis
# Show chart details
helm show chart aliyun/redis
# Install a chart
helm install wyx aliyun/redis
# List releases
helm list
# Get release status
helm status db
# View history
helm history db

Deploying MySQL with Helm

# Pull MySQL chart
helm pull azure/mysql
# Extract chart files
tar xvf mysql-1.6.9.tgz
# Edit values.yaml to disable persistence
persistence:
  enabled: false
# Upgrade release
helm upgrade db .
# Verify pods
kubectl get pod
# Connect to MySQL
mysql -u root -p123456 -h 10.244.36.77

Helm Chart Structure

charts/ : stores dependent sub‑charts.

Chart.yaml : required metadata file (name, version, description, etc.).

templates/ : contains Kubernetes manifest templates (deployment.yaml, service.yaml, _helpers.tpl, hpa.yaml, ingress.yaml, NOTES.txt, serviceaccount.yaml, tests/).

values.yaml : default configuration values used by templates.

Creating a Chart

# Create a new chart named wyx
helm create wyx
# Directory layout
wyx/
├── charts
├── Chart.yaml
├── templates
│   ├── deployment.yaml
│   ├── _helpers.tpl
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── NOTES.txt
│   ├── serviceaccount.yaml
│   ├── service.yaml
│   └── tests
│       └── test-connection.yaml
└── values.yaml

Defining Templates

# Example deployment template (nginx)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.deployname }}
  labels:
    app: hw-nginx
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: hw-nginx
  template:
    metadata:
      labels:
        app: hw-nginx
    spec:
      containers:
      - name: hw-nginx
        image: {{ .Values.images.repository }}
        ports:
        - containerPort: 80

# Example service template
apiVersion: v1
kind: Service
metadata:
  name: hw-nginx
  namespace: {{ .Release.Namespace }}
spec:
  type: NodePort
  selector:
    app: hw-nginx
  ports:
  - name: http
    port: 80
    targetPort: 80
    nodePort: 30001
    protocol: TCP

Debugging

Helm provides --dry-run and --debug flags to render templates without performing an actual release.

# Dry‑run install with debug output
helm install --dry-run --debug web1 nginx/

Built‑in Objects

release.name – name of the release.

release.namespace – namespace where the release is deployed.

release.service – service name associated with the release.

release.revision – revision number of the release, incremented on each upgrade.

Values Hierarchy

Chart’s own values.yaml provides default values.

Parent chart’s values.yaml can override child chart defaults when used as a dependency.

Custom -f or --values files supplied to helm install or helm upgrade override chart defaults.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeDeploymentKubernetesDevOpshelmchart
MaGe Linux Operations
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.