Helm Cheat Sheet: Personal Top of the Little Known Commands and Features

Helm is a package manager for Kubernetes. It’s got an outstanding official documentation and tons of tutorials on the internet. Nonetheless Helm has some helpful commands and features that are easily overlooked when reading the documentation. I won’t even try to cover them all, as it’s quite subjective what to count as “helpful”. What I will try to do though is to give a direction on how to find such features by yourself.

CLI Help

Just like kubectl and minikube Helm’s CLI tool follows the same help patterns for commands and subcommands:

$ helm --help
$ helm get --help
$ helm get values --help

Shell Completion

Again, just like kubectl and minikube Helm provides shell commands completion for bash and zsh. See more in help:

$ helm completion --help

Completion helps a lot both everyday interaction with Helm and its CLI exploration.

Commands Aliases

Some Helm commands have aliases. You can see then in the corresponding section in help. As an example these two commands are the same:

$ helm list
$ helm ls

Chart Values

Helm charts usually get initialized with some default values. It’s worth inspect them before installation:

$ helm inspect values stable/postgresql

Sometimes it’s also very helpful to get values from the deployed release, both explicitly set by user and taken from the defaults:

$ helm get values --all <your-release-name>

Chart Versions

Every chart must have a version number. Charts are versioned under version control systems (VSC) and installed from the chart repositories. You can list existing repos with:

$ helm repo list

Don’t forget to update packages information for your repos with:

$ helm repo update

Sometimes you may want to install specific version of chart. List versions first:

$ helm search --versions stable/postgresql

Now install the chart with a --version argument:

$ helm intall --version 3.17.0 stable/postgresql

Chart deletion

If you ommit --name <your-release-name> argument when doing helm install you get a random release name. Release names are reserved even after your release is deleted, so that you can do a rollback.

If you are using a your own release name you can get into trouble when reinstalling chart with the same name. In order to avoid name clash delete your release like so:

$ helm delete --purge <your-release-name>

In this case you won’t be able to do a rollback though.

Emulate Installation

We’ve already covered inspect a little bit. It allows you to see chart’s info, values and a README file. But sometimes you may want to get dirty in chart’s guts (actually, I always do as I don’t really like the idea of installing something I don’t understand in my k8s cluster). In this case you may want to emulate installation with verbose output:

$ helm install --dry-run --debug --version 3.17.0 stable/postgresql

Having chart manifests at your fingertips is a great way to save time and effort browsing for the source code.

Conclusion

Helm’s got almost everything needed to start working with it in its help. It’s consistent and mimics other k8s CLI tools like kubectl and minikube. Take your time to explore the help! I didn’t really try to cover everything here. I just scratched the surface with less known things that you actually could found out by exploring the help.

I’m going to update this post as I find new features worth sharing.