DEV Community

Cover image for Useful commands for Helm
Raul Naupari
Raul Naupari

Posted on • Originally published at blog.raulnq.com

Useful commands for Helm

Helm is an open source package manager for Kubernetes. It provides the ability to provide, share, and use software built for Kubernetes.

In this post, we will cover the most common Helm commands (and their most common parameters) from our daily work and provide a brief review of the core concepts. You can review the official documentation here.

Helm core concepts

  • The Chart is a Helm package that contains information sufficient for installing a set of Kubernetes resources into a Kubernetes cluster.

  • The Repository is a simple HTTP server to store collection of charts. You can search, download and install charts from a repository.

  • The Release is an instance or a deployment of a chart. When you perform a helm install command, you are creating a new release of that chart on your Kubernetes cluster.

Helm commands

Repository management

List chart repositories:

helm repo list 
Enter fullscreen mode Exit fullscreen mode
helm repo list NAME URL bitnami https://charts.bitnami.com/bitnami ingress-nginx https://kubernetes.github.io/ingress-nginx 
Enter fullscreen mode Exit fullscreen mode

Search for charts in the local repositories:

helm search repo [keyword] 
Enter fullscreen mode Exit fullscreen mode
helm search repo rabbitmq NAME CHART VERSION APP VERSION DESCRIPTION bitnami/rabbitmq 9.0.0 3.9.16 RabbitMQ is an open source general-purpose mess... bitnami/rabbitmq-cluster-operator 2.6.0 1.12.1 The RabbitMQ Cluster Kubernetes Operator automa... 
Enter fullscreen mode Exit fullscreen mode

Search for charts in the Artifact Hub:

helm search hub [keyword] -o yaml 
Enter fullscreen mode Exit fullscreen mode
helm search hub jaeger -o yaml - app_version: 1.17.1 description: A Jaeger Helm chart for Kubernetes repository: name: hkube url: https://hkube.io/helm/ url: https://artifacthub.io/packages/helm/hkube/jaeger version: 0.27.2006 - app_version: 1.30.0 description: A Jaeger Helm chart for Kubernetes repository: name: jaegertracing url: https://jaegertracing.github.io/helm-charts url: https://artifacthub.io/packages/helm/jaegertracing/jaeger version: 0.56.1 
Enter fullscreen mode Exit fullscreen mode

Add a repository:

helm repo add [repository] [repository-url] 
Enter fullscreen mode Exit fullscreen mode
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts "jaegertracing" has been added to your repositories 
Enter fullscreen mode Exit fullscreen mode

Update information of charts in local repositories:

helm repo update 
Enter fullscreen mode Exit fullscreen mode
helm repo update Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "ingress-nginx" chart repository ...Successfully got an update from the "jaegertracing" chart repository 
Enter fullscreen mode Exit fullscreen mode

Chart management

Using packages created by us

Create a directory containing the common chart files and directories:

helm create [chart] 
Enter fullscreen mode Exit fullscreen mode
helm create demo-app Creating demo-app 
Enter fullscreen mode Exit fullscreen mode

Examine a chart for possible issues:

helm lint [chart] 
Enter fullscreen mode Exit fullscreen mode
helm lint demo-app ==> Linting demo-app [INFO] Chart.yaml: icon is recommended 
Enter fullscreen mode Exit fullscreen mode

Upgrade a release:

helm upgrade [release] [chart] 
Enter fullscreen mode Exit fullscreen mode
--namespace namespace scope for this request --install if a release by this name doesn't already exist, run an install --dry-run simulate an upgrade --debug enable verbose output --values specify values in a YAML file or a URL (can specify multiple) --set set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --create-namespace if --install is set, create the release namespace if not present 
Enter fullscreen mode Exit fullscreen mode
helm upgrade release-demo demo-app --debug --install --values values.local.yaml --set image.tag=1.0.0 
Enter fullscreen mode Exit fullscreen mode

Package a chart directory into a chart archive:

helm package [chart] --app-version 
Enter fullscreen mode Exit fullscreen mode
helm package demo-app --app-version 1.0.0 Successfully packaged chart and saved it to: C:\demo-app-1.0.0.tgz 
Enter fullscreen mode Exit fullscreen mode

Push a chart to a remote repository (depending on the server):

Using packages from a remote repository

Show the chart's definition:

helm show chart [chart] 
Enter fullscreen mode Exit fullscreen mode
helm show chart ingress-nginx/ingress-nginx apiVersion: v2 appVersion: 1.2.0 description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer home: https://github.com/kubernetes/ingress-nginx icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png keywords: - ingress - nginx kubeVersion: '>=1.19.0-0' maintainers: - name: rikatz - name: strongjz - name: tao12345666333 name: ingress-nginx sources: - https://github.com/kubernetes/ingress-nginx type: application version: 4.1.0 
Enter fullscreen mode Exit fullscreen mode

Show the chart's values:

helm show values [chart] 
Enter fullscreen mode Exit fullscreen mode

Download a chart from a repository:

helm pull [chart] 
Enter fullscreen mode Exit fullscreen mode
helm pull ingress-nginx/ingress-nginx 
Enter fullscreen mode Exit fullscreen mode

Install a chart:

helm install [release] [chart] 
Enter fullscreen mode Exit fullscreen mode
helm install ingress-nginx/ingress-nginx 
Enter fullscreen mode Exit fullscreen mode

Release management

List releases:

helm list --namespace [namespace] 
Enter fullscreen mode Exit fullscreen mode
helm list --namespace default NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION release-demo default 3 2022-04-27 14:09:35.2202953 -0500 -05 failed demo-app-1.0.0 1.16.0 
Enter fullscreen mode Exit fullscreen mode

Fetch release history:

helm history [release] 
Enter fullscreen mode Exit fullscreen mode
helm history release-demo REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Wed Apr 27 08:52:02 2022 superseded demo-app-0.1.0 1.16.0 Upgrade complete 2 Wed Apr 27 12:53:03 2022 deployed demo-app-0.1.0 1.16.0 Upgrade complete 3 Wed Apr 27 14:09:35 2022 failed demo-app-1.0.0 1.16.0 Upgrade "demo-app" failed: pre-upgrade hooks failed: timed out waiting for the condition 
Enter fullscreen mode Exit fullscreen mode

Rollback a release to a previous revision:

helm rollback [release] [revision] 
Enter fullscreen mode Exit fullscreen mode
helm rollback demo-app 2 Rollback was a success! Happy Helming! 
Enter fullscreen mode Exit fullscreen mode

Uninstall a release:

helm uninstall [release] 
Enter fullscreen mode Exit fullscreen mode
helm uninstall demo-app release "demo-app" uninstalled 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)