Helm charts are one of the best practices for building efficient clusters in Kubernetes. It is a form of packaging that uses a collection of Kubernetes resources. Helm charts use those resources to define an application.
Helm charts use a template approach to deploy applications. Templates give structure to projects and are suitable for any type of application.
This article provides step-by-step instructions to create and deploy a Helm chart.
- Access to a CLI
- Minikube cluster installed and configured. (For assistance, follow our guides How to Install Minikube on Ubuntu and How to Install Minikube on CentOS.)
- Helm installed and configured.
Note: To confirm Helm installed properly, run
which helm in the terminal. The output should return a path to Helm.
Create Helm Chart
Creating a Helm chart involves creating the chart itself, configuring the image pull policy, and specifying additional details in the values.yaml file.
Step 1: Create a New Helm Chart
1. To create a new Helm chart, use:
helm create <chart name>
helm create phoenixnap
2. Using the ls command, list the chart structure:
ls <chart name>
The Helm chart directory contains:
- Directory charts – Used for adding dependent charts. Empty by default.
- Directory templates – Configuration files that deploy in the cluster.
- YAML file – Outline of the Helm chart structure.
- YAML file – Formatting information for configuring the chart.
Step 2: Configure Helm Chart Image Pull Policy
1. Open the values.yaml file in a text editor. Locate the image values:
There are three possible values for the pullPolicy:
IfNotPresent– Downloads a new version of the image if one does not exist in the cluster.
Always– Pulls the image on every restart or deployment.
Latest– Pulls the most up-to-date version available.
2. Change the image pullPolicy from
Step 3: Helm Chart Name Override
To override the chart name in the values.yaml file, add values to the nameOverride and fullnameOverride:
Overriding the Helm chart name ensures configuration files also change.
Step 4: Specify Service Account Name
The service account name for the Helm chart generates when you run the cluster. However, it is good practice to set it manually.
The service account name makes sure the application is directly associated with a controlled user in the chart.
1. Locate the serviceAccount value in the values.yaml file:
2. Specify the name of the service account:
Step 5: Change Networking Service Type
The recommended networking service type for Minikube is
1. To change the networking service type, locate the service value:
2. Change the type from
Deploy Helm Chart
After configuring the values.yaml file, check the status of your Minikube cluster and deploy the application using Helm commands.
Step 1: Check minikube Status
If Minikube isn’t running, the install Helm chart step returns an error.
1. Check Minikube status with:
The status shows up as Running.
2. If the status shows Stopped, run:
The output shows Done and the status changes to Running.
Step 2: Install the Helm Chart
Install the Helm chart using the
helm install command:
helm install <full name override> <chart name>/ --values <chart name>/values.yaml
helm install phoenix-chart phoenixnap/ --values phoenixnap/values.yaml
helm install command deploys the app. The next steps are printed in the NOTES section of the output.
Step 3: Export the Pod Node Port and IP Address
1. Copy the two
export commands from the
helm install output.
2. Run the commands to get the Pod node port and IP address:
Step 4: View the Deployed Application
1. Copy and paste the
echo command and run it in the terminal to print the IP address and port:
2. Copy the link and paste it into your browser, or press CTRL+click to view the deployed application:
Note: Learn how to delete a Helm deployment and namespace to get rid of unwanted or multiple copies of Helm deployments.
After following the outlined step-by-step instructions, you have a Helm chart created, set up, and deployed on a web server. Helm charts simplify application deployment on a Kubernetes cluster.
Now that you have created a Helm chart, learn How to Pull And Push Helm Charts.