
- Kubernetes Tutorial
- Kubernetes - Home
- Kubernetes - Overview
- Kubernetes - Architecture
- Kubernetes - Setup
- Kubernetes - Setup on Ubuntu
- Kubernetes - Images
- Kubernetes - Jobs
- Kubernetes - Labels & Selectors
- Kubernetes - Namespace
- Kubernetes - Node
- Kubernetes - Service
- Kubernetes - POD
- Kubernetes - Replication Controller
- Kubernetes - Replica Sets
- Kubernetes - Deployments
- Kubernetes - Volumes
- Kubernetes - Secrets
- Kubernetes - Network Policy
- Advanced Kubernetes
- Kubernetes - API
- Kubernetes - Kubectl
- Kubernetes - Kubectl Commands
- Kubernetes - Creating an App
- Kubernetes - App Deployment
- Kubernetes - Autoscaling
- Kubernetes - Dashboard Setup
- Kubernetes - Helm Package Management
- Kubernetes - CI/CD Integration
- Kubernetes - Persistent Storage and PVCs
- Kubernetes - RBAC
- Kubernetes - Logging & Monitoring
- Kubernetes - Service Mesh with Istio
- Kubernetes - Backup and Disaster Recovery
- Managing ConfigMaps and Secrets
- Running Stateful Applications
- Kubernetes Useful Resources
- Kubernetes - Quick Guide
- Kubernetes - Useful Resources
- Kubernetes - Discussion
Helm Package Management in Kubernetes
Helm is a package manager for Kubernetes that simplifies the deployment, configuration, and management of applications. In this guide, we'll use Helm to define, install, and upgrade complex Kubernetes applications using Helm charts. This tool is particularly useful in production environments where consistency, automation, and ease of upgrades are essential.
Why Use Helm?
Helm charts encapsulate application dependencies and configurations, reducing manual effort. Deploying a complex application like WordPress becomes straightforward with just a few commands.
Helm maintains version history, allowing us to easily roll back to previous configurations if something goes wrong. This provides the ability to revert to a stable state after an unsuccessful upgrade.
Helm ensures uniform deployments across multiple environments. Whether it's staging, testing, or production, we can be confident that the deployments are consistent.
Helm allows us to override values without modifying the core configurations. It means we can customize our deployments for different environments without changing the underlying code.
Installing Helm
To install Helm on Ubuntu, well start by running the following command −
$ curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
During installation, Helm downloads the necessary binaries and verifies the checksum before installing −
Downloading https://get.helm.sh/helm-v3.17.1-linux-amd64.tar.gz Verifying checksum... Done. Preparing to install helm into /usr/local/bin helm installed into /usr/local/bin/helm
Once installed, verify the installation by checking the Helm version −
$ helm version
Output
version.BuildInfo{Version:"v3.17.1", GitCommit:"980d8ac1939e39138101364400756af2bdee1da5", GitTreeState:"clean", GoVersion:"go1.23.5"}
This confirms that Helm has been successfully installed and is ready for use.
Helm Architecture
Helm consists of two main components −
- Helm CLI − The command-line tool used to interact with Helm charts.
- Helm Charts − Pre-configured application definitions, similar to package managers like apt or yum.
Helm Charts
A Helm chart is a collection of YAML files defining Kubernetes resources and configurations. Helm charts simplify the deployment of complex applications such as MySQL, Prometheus, and more.
Creating a Helm Chart
To create a custom Helm chart, we'll use the following command −
$ helm create mychart
This command generates a directory structure −
$ ls
Output
charts Chart.yaml templates values.yaml
The key components include −
- Chart.yaml − Contains metadata about the chart, such as the name, version, and description.
- values.yaml − Defines default configuration values that we can override during deployment.
- templates/ − Contains Kubernetes manifest templates, which define the actual resources to be created.
Installing a Helm Chart
To deploy an application using a Helm chart, we'll use the following command −
$ helm install myapp ./mychart
If the chart is located in the current directory, the path should be prefixed with ./ to avoid errors.
Once installed, Helm confirms a successful deployment −
NAME: myapp LAST DEPLOYED: Wed Feb 26 16:09:44 2025 NAMESPACE: default STATUS: deployed REVISION: 1
To verify the deployed Helm release, we will use the following command −
$ helm list
Output
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION myapp default 1 2025-02-26 16:09:44.191518589 +0300 EAT deployed mychart-0.1.0 1.16.0
Accessing the Application
After deployment, we can retrieve the application's pod name and container port with −
$ export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=mychart,app.kubernetes.io/instance=myapp" -o jsonpath="{.items[0].metadata.name}") $ export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
Then, we forward the application's port to make it accessible locally −
$ kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
Once port forwarding is active, we can visit http://127.0.0.1:8080 in a browser. If everything is working correctly, we should see the following welcome page −

This confirms that the application is running correctly and is accessible through port forwarding. In this case, we deployed an Nginx-based application, and the default welcome page indicates that Nginx has been successfully installed.
Using Helm with Real-World Applications
Deploying MySQL with Helm
We can deploy a MySQL database using Helm. First, we add the Bitnami repository −
$ helm repo add bitnami https://charts.bitnami.com/bitnami
Output
"bitnami" has been added to your repositories
Update the repository −
$ helm repo update
Output
Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "bitnami" chart repository Update Complete. Happy Helming!
Deploy MySQL −
$ helm install mymysql bitnami/mysql
Output
NAME: mymysql LAST DEPLOYED: Wed Feb 26 19:36:12 2025 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: CHART NAME: mysql CHART VERSION: 12.3.0 APP VERSION: 8.4.4
Verify the deployment −
$ kubectl get pods
Output
NAME READY STATUS RESTARTS AGE myapp-mychart-7d49757dc6-xqrqt 1/1 Running 0 3h48m mymysql-0 0/1 Pending 0 93m test-pod 0/1 Completed 0 31h
Upgrading a Helm Release
If changes need to be applied, we can upgrade the deployment using −
$ helm upgrade myapp mychart
Output
Release "myapp" has been upgraded. Happy Helming! NAME: myapp LAST DEPLOYED: Wed Feb 26 16:21:55 2025 NAMESPACE: default STATUS: deployed REVISION: 2
Uninstalling a Helm Release
To remove a Helm deployment, use −
$ helm uninstall myapp
Output
release "myapp" uninstalled
Helm Rollbacks
If an upgrade introduces issues, we can roll back to a previous release by using the following command −
$ helm rollback myapp 1
Output
Rollback was a success! Happy Helming!
This reverts the deployment to revision 1. If a faulty update is deployed, rolling back ensures application stability.
Helm Best Practices
Here is a list of some of the best practices while using Helm -
- Use version-controlled Helm charts for consistency across deployments.
- Use values.yaml to manage configurations without modifying templates.
- Regularly update repositories to ensure we are using the latest chart versions.
- Test charts in a staging environment before deploying to production.
Conclusion
Helm is an essential tool for managing Kubernetes applications efficiently. It simplifies deployments, enables version control, and provides a consistent way to package applications. By leveraging Helm charts, we can deploy, upgrade, and manage applications with minimal manual effort.