Helm and it’s commands

Reading Time: 5 minutes

Hello Readers, In this blog, we’ll learn about Helm and it’s commands which is calls itself ”The Kubernetes package manager”.

What is Helm?

Helm is a package manager for Kubernetes. It is the K8s equivalent of yum or apt.Helm deploys charts, which you can think of as a packaged application. It is a collection of all your versioned, pre-configured application resources which can be deployed as one unit. You can then deploy another version of the chart with a different set of configuration.

Helm itself is stateful. When a Helm Chart gets installed, the defined resources are getting deployed and meta-information is stored in Kubernetes secrets.

  • Release : A release is an instance of a chart chart running in a k8s cluster.one chart can after be installed many times into the same cluster and each time it is installed, a new release is created.
  • Repository : Location where packaged chart can be stored and shared.
  • Helm Hub :Helm hub is an online collection of distributed repositories available on the internet. It works as an information center, where you can find apps and their repository addresses. As of today, it is not possible to install an app directly from Helm Hub.
  • Helm Chart : It is a collection of templates and settings that describe a set of Kubernetes resources. or A chart is a set of Kubernetes yaml manifests packaged together for easy manipulation. Helm charts make it possible to deploy a containerized application using a single command.

Prerequisite

To start using helm command you must have to install helm and before installation of helm you need to install docker and minikube, then you need to start minikube by using command.

minikube start

you can intsall helm by following this link https://blog.knoldus.com/introduction-to-helm-and-its-installation/

Helm commands

  1. used to add a chart repository.
helm repo add [NAME] [URL] [flags]

for example: helm repo add bitnami https://charts.bitnami.com/bitnami

2. used to list chart repositories.

helm repo list [flags]

for example:helm repository list

3. Used to remove a chart repository.

helm repo remove [NAME] [URL] [flags]

for example: helm repo remove bitnami https://charts.bitnami.com/bitnami

4. Used to Install an app.

helm install [app-name] [chart]

for example:

helm install my-apache bitnami/apache --version 8.0.2

5. Used to list the deployments.

helm list

6. Used to upgrade the deployed application to a new version.

helm upgrade [app-name] [chart] --version

for example:

 helm upgrade my-apache bitnami/apache --version 8.0.3

7. Used to roll back a release to a previous revision.

helm rollback <RELEASE> [REVISION] [flags]

for example: helm rollback my-apache 1

8.This command takes a release name and uninstalls the release.It removes all of the resources associated with the last release of the chart as well as the release history, freeing it up for future use.

helm uninstall RELEASE_NAME [...] [flags]

for example: helm uninstall my-apache

9. used to see the installed version of helm.

helm version

10.This command used to creates a chart directory along with the common files and directories used in a chart.

helm create NAME [flags]

for example: helm create helloworld

11. search for a keyword in charts.Use search subcommands to search different locations for charts.

helm search repo NAME

for example: helm search repo jenkins

12.This command inspects a chart (directory, file, or URL) and displays the contents of the Chart.yaml file.

helm show chart [CHART] [flags]

for example: helm show chart helloworld/

13. This command is used to takes a path to a chart and runs a series of tests to verify that the chart is well-formed.

helm lint PATH [flags]

for example: helm lint helloworld/

14.This command used to render chart templates locally and display the output.

helm template [NAME] [CHART] [flags]

This will generate all templates with variables and show the output. Now that we know everything is OK, we can deploy the chart

15.This command shows the status of a named release. The status consists of:

  • last deployment time
  • k8s namespace in which the release lives
  • state of the release (can be: unknown, deployed, uninstalled, superseded, failed, uninstalling, pending-install, pending-upgrade or pending-rollback)
  • revision of the release
helm status RELEASE_NAME [flags]

for example: helm status testchart2

Reference:

https://helm.sh/docs/

https://blog.knoldus.com/how-to-implement-wordpress-using-helm-chart-on-kubernetes/

https://www.cncf.io/blog/

In Conclusion:

The tutorial listed the most common Helm commands used in your Kubernetes cluster and what is Helm. I hope you enjoyed this hands-on tutorial. Motivate yourself to Google around, check out other examples, deploy containers, connect them, and use them.