wget http://rancher-mirror.cnrancher.com/helm/v3.4.1/helm-v3.4.1-linux-amd64.tar.gz tar -zxvf helm-v3.4.1-linux-amd64.tar.gz cp linux-amd64/helm /usr/local/bin/helm3
确认helm版本
1 2 3
# helm3 version WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config version.BuildInfo{Version:"v3.4.1", GitCommit:"c4e74854886b2efe3321e185578e6db9be0a6e29", GitTreeState:"clean", GoVersion:"go1.14.11"}
# helm3 plugin list WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config NAME VERSION DESCRIPTION 2to3 0.7.0 migrate and cleanup Helm v2 configuration and releases in-place to Helm v3
# helm3 2to3 move config WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config 2020/12/07 16:25:32 WARNING: Helm v3 configuration may be overwritten during this operation. 2020/12/07 16:25:32 [Move config/confirm] Are you sure you want to move the v2 configuration? [y/N]: y 2020/12/07 16:25:35 Helm v2 configuration will be moved to Helm v3 configuration. 2020/12/07 16:25:35 [Helm 2] Home directory: /root/.helm 2020/12/07 16:25:35 [Helm 3] Config directory: /root/.config/helm 2020/12/07 16:25:35 [Helm 3] Data directory: /root/.local/share/helm 2020/12/07 16:25:35 [Helm 3] Cache directory: /root/.cache/helm 2020/12/07 16:25:35 [Helm 3] Create config folder "/root/.config/helm" . 2020/12/07 16:25:35 [Helm 3] Config folder "/root/.config/helm" created. 2020/12/07 16:25:35 [Helm 2] repositories file "/root/.helm/repository/repositories.yaml" will copy to [Helm 3] config folder "/root/.config/helm/repositories.yaml" . 2020/12/07 16:25:35 [Helm 2] repositories file "/root/.helm/repository/repositories.yaml" copied successfully to [Helm 3] config folder "/root/.config/helm/repositories.yaml" . 2020/12/07 16:25:35 [Helm 3] Create cache folder "/root/.cache/helm" . 2020/12/07 16:25:35 [Helm 3] cache folder "/root/.cache/helm" created. 2020/12/07 16:25:35 [Helm 3] Create data folder "/root/.local/share/helm" . 2020/12/07 16:25:35 [Helm 3] data folder "/root/.local/share/helm" created. 2020/12/07 16:25:35 [Helm 2] starters "/root/.helm/starters" will copy to [Helm 3] data folder "/root/.local/share/helm/starters" . 2020/12/07 16:25:35 [Helm 2] starters "/root/.helm/starters" copied successfully to [Helm 3] data folder "/root/.local/share/helm/starters" . 2020/12/07 16:25:35 Helm v2 configuration was moved successfully to Helm v3 configuration.
看到successfully则说明迁移成功,使用helm3命令查看repo
1 2 3 4 5 6
# helm3 repo list WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config NAME URL local http://127.0.0.1:8879/charts jetstack https://charts.jetstack.io rancher-stable https://releases.rancher.com/server-charts/stable
可以看到,repo已经迁移成功
迁移helm2 release到helm3
首先查看helm2中的release
1 2 3 4
# helm list NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE cert-manager 1 Mon Dec 7 14:49:16 2020 DEPLOYED cert-manager-v0.8.1 v0.8.1 cert-manager rancher 1 Mon Dec 7 14:51:20 2020 DEPLOYED rancher-2.2.9 v2.2.9 cattle-system
迁移rancher
1 2 3 4 5 6 7 8 9 10 11 12 13
# helm3 2to3 convert rancher WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config WARNING: "kubernetes-charts.storage.googleapis.com" is deprecated for"stable" and will be deleted Nov. 13, 2020. WARNING: You should switch to "https://charts.helm.sh/stable" via: WARNING: helm repo add "stable""https://charts.helm.sh/stable" --force-update 2020/12/07 16:33:31 Release "rancher" will be converted from Helm v2 to Helm v3. 2020/12/07 16:33:31 [Helm 3] Release "rancher" will be created. 2020/12/07 16:33:31 [Helm 3] ReleaseVersion "rancher.v1" will be created. 2020/12/07 16:33:31 [Helm 3] ReleaseVersion "rancher.v1" created. 2020/12/07 16:33:31 [Helm 3] Release "rancher" created. 2020/12/07 16:33:31 Release "rancher" was converted successfully from Helm v2 to Helm v3. 2020/12/07 16:33:31 Note: The v2 release information still remains and should be removed to avoid conflicts with the migrated v3 release. 2020/12/07 16:33:31 v2 release information should only be removed using `helm 2to3` cleanup and when all releases have been migrated over.
使用helm3查看release list(helm3 需要设置命名空间)
1 2 3 4
# helm3 list -n cattle-system WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION rancher cattle-system 1 2020-12-07 15:49:04.20697732 +0000 UTC deployed rancher-2.2.9 v2.2.9