Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

# IT star is not a dream # the article teaches you to complete Helm 3 migration at once

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

In 2019, the Kubernetes package manager, Helm, released the latest version of Helm 3, which is already stable. Some of the key features in Helm 3 have been introduced in previous articles, some of which have attracted many developers. So, now you're probably wondering if it's troublesome to upgrade / migrate to a new version of Helm. Although Helm can be complex, don't worry, the upgrade process is extremely simple. Helm's official blog provides a detailed guide to the migration process. Please refer to:

Https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/

This official guide intuitively tells you everything you need to prepare for migrating versions to Helm 3 separately. But what if you want to complete the migration at once? How do you make sure that no components are using Tiller before deleting it

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. I wrote an article (https://itnext.io/breaking-changes-in-helm-3-and-how-to-fix-them-39fea23e06ff) that covered some things to pay attention to, most of which can be easily solved. 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

The Helm blog post I mentioned at the beginning of the article has a detailed description of this step, which will update all your local configuration so that Helm 3 can use it:

Https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/#migrate-helm-v2-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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report