Helm V2 迁移到 V3
一键安装:
检查插件是否安装成功:
$ helm3 plugin list
NAME VERSION DESCRIPTION
2to3 0.1.1 migrate Helm v2 configuration and releases in-place to Helm v3
$ helm3 2to3 move config
[Helm 2] Home directory: /root/.helm
[Helm 3] Config directory: /root/.config/helm
[Helm 3] Data directory: /root/.local/share/helm
[Helm 3] Create config folder "/root/.config/helm" .
[Helm 3] Config folder "/root/.config/helm" created.
[Helm 2] repositories file "/root/.helm/repository/repositories.yaml" will copy to [Helm 3] config folder "/root/.config/helm/repositories.yaml" .
[Helm 2] repositories file "/root/.helm/repository/repositories.yaml" copied successfully to [Helm 3] config folder "/root/.config/helm/repositories.yaml" .
[Helm 3] Create data folder "/root/.local/share/helm" .
[Helm 3] data folder "/root/.local/share/helm" created.
[Helm 2] plugins "/root/.helm/plugins" will copy to [Helm 3] data folder "/root/.local/share/helm/plugins" .
[Helm 2] plugins "/root/.helm/plugins" copied successfully to [Helm 3] data folder "/root/.local/share/helm/plugins" .
[Helm 2] starters "/root/.helm/starters" copied successfully to [Helm 3] data folder "/root/.local/share/helm/starters" .
- Chart 仓库
- Helm 插件
- Chart starters
检查下 repo 和 plugin:
已经用 Helm V2 部署的应用也可以使用 2to3
的 子命令迁移到 V3,先看下有哪些选项:
$ helm3 2to3 convert --help
migrate Helm v2 release in-place to Helm v3
Usage:
2to3 convert [flags] RELEASE
Flags:
--delete-v2-releases v2 releases are deleted after migration. By default, the v2 releases are retained
--dry-run simulate a convert
-h, --help help for convert
-l, --label string label to select tiller resources by (default "OWNER=TILLER")
-s, --release-storage string v2 release storage type/object. It can be 'secrets' or 'configmaps'. This is only used with the 'tiller-out-cluster' flag (default "secrets")
-t, --tiller-ns string namespace of Tiller (default "kube-system")
--tiller-out-cluster when Tiller is not running in the cluster e.g. Tillerless
--tiller-out-cluster
: 如果你的 Helm V2 是 tiller 在集群外面 (tillerless) 的安装方式,请带上这个参数--tiller-ns
: 通常 tiller 如果部署在集群中,并且不在kube-system
命名空间才指定
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
redis 1 Mon Sep 16 14:46:58 2019 DEPLOYED redis-9.1.3 5.0.5 default
选一个用 --dry-run
试下效果:
没有报错,去掉 --dry-run
执行迁移:
$ helm3 2to3 convert redis
Release "redis" will be converted from Helm 2 to Helm 3.
[Helm 3] Release "redis" will be created.
[Helm 3] ReleaseVersion "redis.v1" will be created.
[Helm 3] ReleaseVersion "redis.v1" created.
[Helm 3] Release "redis" created.
Release "redis" was converted successfully from Helm 2 to Helm 3. Note: the v2 releases still remain and should be removed to avoid conflicts with the migrated v3 releases.
$ helm ls
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
redis 1 Mon Sep 16 14:46:58 2019 DEPLOYED redis-9.1.3 5.0.5 default
$
$
$ helm3 ls -a
NAME NAMESPACE REVISION UPDATED STATUS CHART
- How to migrate from Helm v2 to Helm v3: https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/