Upgrading Helm v2 to Helm v3 on Windows

  • Tiller has been removed. This is huge because as you saw in a previous post, managing RBAC permissions can get a bit out of hand. From the Helm website listed above:
  • A 3-way strategic merge patch has been implemented over the former 2-way. This means Helm will keep track of the original manifest, the live state, and the new manifest. This will alleviate a sticky situation when you try to rollback after making a live change.
  • Release names are now scoped to the namespace the release is deployed in, whereas before you would have to basically ask the tiller service.
  • Secrets are now the default storage driver, as opposed to the previous ConfigMaps.
  • Helm import path changes for Golang projects from k8s.io/helmto helm.sh/helm/v3.
  • Chart apiVersion bumped to v2 in Chart.yaml file.

Assessing the current state of things

As you are getting started, it would be good to dig up your documentation or take some quick notes about the state of your environment.

helm list --tiller-namespace <tiller namespace>
Using an older version of helm to verify my releases
helm repo list
more useful information

How to migrate to V3

The rest of this article describes work that is destructive and is meant for testing purposes only.

We will need to complete the following:

  • Migration of Helm v2 configuration. This essentially is updating the helm executable and configuration to Helm v3.
  • Migration of Helm v2 releases. This is updating your releases to v3, along with your charts and requirements.yml files.
  • Clean up Helm v2 configuration, release data and Tiller deployment.

Step 0. Install Helm v3

Upgrade helm. Don’t worry, you can always download v2 and use your old manifests if you need to.

choco upgrade kubernetes-helm 
upgrade helm

Step 1. Migration of Helm v2 Config

Install the helm 2to3 plugin

Turns out the team at Helm has built us a plugin to get us going.

helm plugin install https://github.com/helm/helm-2to3
An error
helm plugin list
Looks like it’s installed
helm 2to3 move config --dry-run
Looks like I don’t have the right files, probably because of a failed installation
C:\Users\<your user name>\AppData\Local\Temp\helm\plugins\https-github.com-helm-helm-2to3\bin\
helm 2to3 move config --dry-run
helm 2to3 move config
helm version
v3.0.2

Check your plugins

Ensure all your plugins work. Remove and reinstall your plugins as a first step measure, and if they still don’t work, check the code repository to see if there are any updates.

Remove your local repositories

It is also recommended to remove and re-add your local repositories.

helm repo list
helm repo remove <repository NAME>
Removing my repositories
helm repo add <repository NAME> <URL>
helm repo update

Step 2. Migration of Helm v2 Releases

This step is so that when you run the new helm v3, you can see all your deployed releases and not rely on tiller anymore.

helm list --namespace <any namespace where you have a release>
Empty list
helm 2to3 convert --dry-run <release NAME> --tiller-ns <tiller namespace>
Converting your releases to helm v3
helm 2to3 convert <release NAME> --tiller-ns <tiller namespace>
helm list --namespace <any namespace where you have a release>
My Spinnaker release now shows up

Update your charts

The best thing about this upgrade is you don’t have to edit your existing charts right away. Helm v3 still understands the original v1 api format but it is recommended to consolidate your requirements.yaml file into your Chart.yaml and upgrade to v2 of the api.

Chart.yml using the v1 api
requirements.yaml using the v1 api
Chart.yaml updated to the v2 api with dependencies included

Step 3. Clean up the Helm v2 configuration

When everything is up and running and you are ready to remove your helm v2 instance, please proceed.

helm 2to3 cleanup --dry-run -tiller-ns <tiller namespace>
That seems correct to me
helm 2to3 cleanup -tiller-ns <tiller namespace>
Successfully removed my tiller instance
kubectl delete ns airwave-tiller
Poof!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store