Photo by N. on Unsplash
Helm 3 was recently introduced which changed many of the internal bits within the CLI which are not fully backward compatible to those using Helm 2. Fear not, with a couple minor tweaks you can continue to use the Helm charts you know and love!
If you are a maintainer of Helm charts you should probably start with https://helm.sh/docs/faq/#changes-since-helm-2 to see how the changes impact you.
This post, however, focuses on the user experience of consuming charts other folks maintain. Below we’ll review how to install the PostgreSQL chart.
Using Helm install is Now 2 Steps
In the time before Helm 3 installing a chart was as simple as:
helm install stable/postgresql
This assumed you would be using https://github.com/helm/charts as your chart repository.
It is fairly common to deploy helm charts by specifying the absolute url to a chart. With Helm 3+ you’ll need to do
helm installs in two steps:
Add the chart repo to Helm:
helm repo add bitnami https://charts.bitnami.com
Note that there is a newer chart repository at https://hub.helm.sh.
Install the chart:
helm install bitnami/postgresql --version 8.1.2
Using the old charts with Helm 3
If you still wish to use the charts in https://github.com/helm/charts with Helm 3, download the repo and specify the file path:
git clone https://github.com/helm/charts.git cd charts/stable helm install ./postgresql
Namespace is no longer automatically created
In Helm v2 you could specify a namespace during an install and if it didn’t exist, the namespace would be created automatically:
➜ helm2 install postgresql --name postgres2 --namespace=purple
purple namespace would be created automatically:
NAME STATUS AGE default Active 83m kube-node-lease Active 83m kube-public Active 83m kube-system Active 83m purple Active 6m27s
Under Helm v3+ the
orange namespace is not created:
➜ helm3 install postgres3 ./postgresql --namespace=orange Error: create: failed to create: namespaces "orange" not found
You’ll need to remember to create the namespace first until that functionality is added to many of the older charts.
You no longer need to do the
helm init dance, no server side components should make Helm easier to manage for operators in the long run. Hurray!
There are a few additional changes that happened with Helm 3:
helm delis an alias for
helm uninstallwhich no longer has a
--purgeoption since the uninstall cleans up the references.
- When performing an install, there is no longer a
--nameoption, the usage is
helm install [NAME] [CHART] [flags]so simply provide the name as the first parameter to the install.