Skip to content

Three big concepts of helm

1. Helm chart

A chart is a helm package. A Helm chart wraps up your Kubernetes manifests into dynamic templates with a chart version and all of the needed dependencies, which allows you to standardise and distribute your applications.

2. Helm release

A Helm release is an instance of a Helm chart on a Kubernetes cluster. The Helm chart acts as a template for the release, while a release is an actual running Helm application.

3. Helm repositories

Helm repositories store Helm charts like Yum repositories store RPMs. Anyone who needs to install the application on Kubernetes can download the app from Helm repositories using simple Helm commands. A Helm repository can run on any web server, and, therefore, it’s simple to host one. The traditional method involves creating an index.yaml file within the charts directory, which you create in the public folder of your web server, and updating the file manually when you push a chart into the repository.

4. Helm charts Basics

4.1 Create a helm chart

Creating a helm chart using

helm create roshanapp

The folder layout is created as

.
├── Chart.yaml
├── charts
├── templates
   ├── NOTES.txt
   ├── _helpers.tpl
   ├── deployment.yaml
   ├── hpa.yaml
   ├── ingress.yaml
   ├── service.yaml
   ├── serviceaccount.yaml
   └── tests
       └── test-connection.yaml
└── values.yaml

Following folders serve the following purposes

  • charts - used for adding dependent charts
  • templates - configuration files that gets deployed in the cluster
  • values.yaml - values used for helm chart
  • Chart.yaml - outline of the helm chart

Template files are set up with formatting that collects deployment information from the values.yaml file. Therefore, to customize your Helm chart, you need to edit the values file.

4.2 dry running a helm chart

when a chart is created. It can be tested to run in the kubernetes cluster with the following command. This command spits out kubernetes objects that will be created.

helm install --dry-run --debug ./roshanapp --generate-name

4.3 Install helm chart

helm chart can be installed using the following command.

helm install --generate-name roshanapp/ --values buildchart/values.yaml

4.4 helm template

helm template comamnd locallly render templates. It renders chart templates locally and display the output.

helm template roshanapp
helm template -s templates/deployment.yaml .

4.5 helm package

This command packages a chart into a versioned chart archive file. If a path is given, this will look at that path for a chart (which must contain a Chart.yaml file) and then package that directory.

helm package roshanapp

4.6 Uploading package to nexus repo

To push your helm chart to Nexus, we’d first package the chart and then upload the chart using curl to the helm-hosted repository.

helm package roshanapp
curl -v -F file=@chart.tgz -u admin:password https://registry.logpoint.com.np/service/rest/v1/components?repository=helm-hosted
curl -u admin:password https://registry.logpoint.com.np/repository/helmrepo/ --upload-file roshanapp-0.1.0.tgz -v

4.7 Installing helm charts from nexus

To install your Helm chart from Nexus, you need to update your local repo index with the latest packages on Nexus using helm repo update and then run helm install to create a new release from the Chart.

helm repo update
helm install --generate-name nexus/roshanapp --version version