云容器引擎 CCE-Helm v2 Release转换成Helm v3 Release:转换流程(使用Helm v3客户端)

时间:2023-11-01 16:25:54

转换流程(使用Helm v3客户端)

  1. 安装Helm v3客户端,参见安装Helm v3
  2. 安装转换插件。

    # helm plugin install https://github.com/helm/helm-2to3Downloading and installing helm-2to3 v0.10.2 ...https://github.com/helm/helm-2to3/releases/download/v0.10.2/helm-2to3_0.10.2_linux_amd64.tar.gzInstalled plugin: 2to3

  3. 查看已安装的插件,确认插件已安装。

    # helm plugin listNAME VERSION DESCRIPTION                                                               2to3  0.10.2      migrate and cleanup Helm v2 configuration and releases in-place to Helm v3

  4. 模拟转换。

    以test-convert实例为例,执行以下命令进行转换的模拟。若出现以下相关提示,说明模拟转换成功。

    # helm 2to3 convert --dry-run --tiller-out-cluster -s configmaps test-convertNOTE: This is in dry-run mode, the following actions will not be executed.Run without --dry-run to take the actions described below:Release "test-convert" will be converted from Helm v2 to Helm v3.[Helm 3] Release "test-convert" will be created.[Helm 3] ReleaseVersion "test-convert.v1" will be created.

  5. 执行正式转换。若出现以下提示,说明转换成功。

    # helm 2to3 convert --tiller-out-cluster -s configmaps test-convertRelease "test-convert" will be converted from Helm v2 to Helm v3.[Helm 3] Release "test-convert" will be created.[Helm 3] ReleaseVersion "test-convert.v1" will be created.[Helm 3] ReleaseVersion "test-convert.v1" created.[Helm 3] Release "test-convert" created.Release "test-convert" was converted successfully from Helm v2 to Helm v3.Note: The v2 release information still remains and should be removed to avoid conflicts with the migrated v3 release.v2 release information should only be removed using `helm 2to3` cleanup and when all releases have been migrated over.

  6. 正式转换成功后,用户可通过helm list查看已转换成功的模板实例。

    # helm listNAME                NAMESPACE    REVISION UPDATED                           STATUS      CHART              APP VERSIONtest-convert      default   1                2022-08-29 06:56:28.166918487 +0000 UTC       deployed    test-helmold-1 

  7. 转换完成后进行V2 release资源的清理,同样先进行模拟清理,成功后正式清理V2 release资源。

    模拟清理:

    # helm 2to3 cleanup --dry-run --tiller-out-cluster -s configmaps --name test-convertNOTE: This is in dry-run mode, the following actions will not be executed.Run without --dry-run to take the actions described below:WARNING: "Release 'test-convert' Data" will be removed.  [Cleanup/confirm] Are you sure you want to cleanup Helm v2 data? [y/N]: yHelm v2 data will be cleaned up.[Helm 2] Release 'test-convert' will be deleted.[Helm 2] ReleaseVersion "test-convert.v1" will be deleted.

    正式清理:

    # helm 2to3 cleanup --tiller-out-cluster -s configmaps --name test-convertWARNING: "Release 'test-convert' Data" will be removed.  [Cleanup/confirm] Are you sure you want to cleanup Helm v2 data? [y/N]: yHelm v2 data will be cleaned up.[Helm 2] Release 'test-convert' will be deleted.[Helm 2] ReleaseVersion "test-convert.v1" will be deleted.[Helm 2] ReleaseVersion "test-convert.v1" deleted.[Helm 2] Release 'test-convert' deleted.Helm v2 data was cleaned up successfully.

support.huaweicloud.com/usermanual-cce/cce_10_0422.html