Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to complete Helm3 migration at one time

Shulou Source: shulou.com Published: 2022-05-31 20:09:58 10月05日 Update

This article mainly introduces "how to complete Helm3 migration at one time". In daily operation, I believe many people have doubts about how to complete Helm3 migration at one time. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "how to complete Helm3 migration at one time". Next, please follow the editor to study!

Download Helm 3 binaries

We tested Helm 2 and the latest version, so we should have two versions of binaries ready before Helm 2 is completely uninstalled. Download the latest Stable version of the binary and add it to your PATH. Rename the existing v2 binary to helm2 and the latest version to helm3. I saved both versions in / usr/local/bin so that I could switch them at any time:

➜helm2 version Client: & version.Version {SemVer: "v2.16.0", GitCommit: "e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState: "clean"} Server: & version.Version {SemVer: "v2.14.3", GitCommit: "0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState: "clean"}➜ helm3 version version.BuildInfo {Version: "v3.0.1", GitCommit: "7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState: "clean", GoVersion: "go1.13.4"} prepare CI script and Chart

Before you run the upgrade process, you need to make sure that your CI script and custom Chart are compatible with Helm 3. While the OpenAPI authentication mechanism is interesting, it is likely to catch you off guard:

➜helm install prometheus. Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError (Deployment.spec.template.spec.containers\ [0\] .volumeMounts\ [0\]): unknown field "defaultMode" in io.k8s.api.core.v1.VolumeMount

Once you've solved all these troublesome problems, you can start migrating to Helm 3!

Migrate Helm configuration

If you run Helm on a build agent in a CI system such as Jenkins, TeamCity, or TravisCI, you can do this. If you are running Helm on your local machine or on a central server with a persistent file system, be sure to migrate throughout the configuration, especially if you have your own Helm repo or use custom plug-ins. Either way, make sure you have read through this section to determine if it has anything to do with you.

Migrated version (keep Tiller)

Now, we have several ways to achieve migration. You can migrate a specific version to Helm 3 for some testing, which can be found in Helm's official blog. You can also choose to migrate many versions and remove them all from Tiller. Personally, I found it easier to migrate all versions to a given environment at once, but I needed to keep the release data in Tiller until I was sure that Helm 2 was not used anywhere in our environment. In this way, there are no blind spots, and everything uses the same version of Helm:

# List Helm 2 Releases # omit-tls flag if you're not using TLS RELEASES=$ (helm list-tls-aq) # Loop through releases and, for each one, test conversion while IFS= read-r release; do helm3 2to3 convert $release-dry-run done

Tags: Version one-time file binary learning run information plug-in flag system script problem two data way more process environment component and will Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft MySQL MariaDB Linux