Saturday, December 28, 2019

Helm 2 to Helm 3 Upgrade




I've recently updated a project to use Helm 3 instead of Helm 2.
The official article of how to migrate from Helm v2 to Helm v3 mostly refers to the steps of migrating installed releases from Helm 2 to Helm 3, but does not relate to the development steps.
So, I've listed the changes I made to the project setup and build as part of the migration.


Helm setup on the Kubernetes Cluster 


Tiller is out

Tiller is not longer used, so the setup of Helm is different.
You no longer need to run helm init.


Add the stable repo

Helm no longer has the helm init step, but this is a down side.
The helm init used to add the stable repo to the Helm repos.
In case you want to use charts from the stable repo, you need to manually add them:

helm repo add stable https://kubernetes-charts.storage.googleapis.com


The Release Lifecycle


Helm install

Helm v2 had auto generated the release name in case it was not specified.
Helm v3 requires (by default) the release name, hence the helm install syntax had changed.

Instead of:

helm install --name my-release-name ...

Use:

helm install my-release-name ...


Create Namespace

Helm v2 had created the namespace in case it did not exist.
In Helm v3 you will need to manually create it, for example:

kubectl create namespace my-namespace


Helm Delete

Helm v2 kept history of the uninstalled releases, and most of the Helm users used the --purge flag to avoid this behavior, as it prevents reinstalling of the same release (see this issue).
Helm v3 uses the purge flag by default. Also the delete command is an alias to uninstall.

So, instead of:

helm delete my-release-name --purge

Use:
helm uninstall my-release-name


Summary


In this post we have reviewed the development steps required to upgrade a project from using Helm version 2 to use Helm version 3. In general the upgrade was smooth, and not changes were required in the charts themselves. 

No comments:

Post a Comment