Convertir una versión de Helm v2 a v3
Contexto
CCE es totalmente compatible con Helm v3. Esta sección le guía para convertir una versión de Helm v2 a Helm v3. Helm v3 descarta o reconstruye algunas funciones Helm v2 en la capa inferior. Por lo tanto, la conversión es arriesgada hasta cierto punto. Se requiere simulación antes de la conversión.
Para obtener más información, consulte la documentación de la comunidad.
Precauciones
- Helm v2 almacena información de lanzamiento en el ConfigMaps. Helm v3 lo hace en secreto.
- Cuando consulta, actualiza u opera una versión Helm v2 en la consola de CCE, CCE intentará convertir la versión a v3. Si opera en segundo plano, convierta la versión siguiendo las instrucciones que aparecen a continuación.
Proceso de conversión (sin usar el cliente Helm v3)
- Descargue el complemento de conversión helm 2to3 en el nodo CCE.
wget https://github.com/helm/helm-2to3/releases/download/v0.10.2/helm-2to3_0.10.2_linux_amd64.tar.gz
- Descomprime el paquete de complementos.
tar -xzvf helm-2to3_0.10.2_linux_amd64.tar.gz
- Realice la conversión simulada.
Tome la versión test-convert como ejemplo. Ejecute el siguiente comando para simular la conversión: Si se muestra la siguiente información, la simulación se realiza correctamente.
# ./2to3 convert --dry-run --tiller-out-cluster -s configmaps test-convert NOTE: 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.
- Realice la conversión. Si se muestra la siguiente información, la conversión se realiza correctamente.
# ./2to3 convert --tiller-out-cluster -s configmaps test-convert 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. [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.
- Una vez completada la conversión, simule la liquidación de recursos. Después de la simulación, borre los recursos de la versión v2.
Espacio libre simulado:
# ./2to3 cleanup --dry-run --tiller-out-cluster -s configmaps --name test-convert NOTE: 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]: y Helm v2 data will be cleaned up. [Helm 2] Release 'test-convert' will be deleted. [Helm 2] ReleaseVersion "test-convert.v1" will be deleted.
Espacio libre formal:
# ./2to3 cleanup --tiller-out-cluster -s configmaps --name test-convert WARNING: "Release 'test-convert' Data" will be removed. [Cleanup/confirm] Are you sure you want to cleanup Helm v2 data? [y/N]: y Helm 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" d
Proceso de conversión (con el cliente de Helm v3)
- Instale el cliente de Helm v3. Para obtener más información, véase Instalación de Helm v3.
- Instale el complemento de conversión.
# helm plugin install https://github.com/helm/helm-2to3 Downloading 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.gz Installed plugin: 2to3
- Compruebe si el complemento ha sido instalado.
# helm plugin list NAME VERSION DESCRIPTION 2to3 0.10.2 migrate and cleanup Helm v2 configuration and releases in-place to Helm v3
- Realice la conversión simulada.
Tome la versión test-convert como ejemplo. Ejecute el siguiente comando para simular la conversión: Si se muestra la siguiente información, la conversión simulada se realiza correctamente.
# helm 2to3 convert --dry-run --tiller-out-cluster -s configmaps test-convert NOTE: 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.
- Realice la conversión. Si se muestra la siguiente información, la conversión se realiza correctamente.
# helm 2to3 convert --tiller-out-cluster -s configmaps test-convert 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. [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.
- Después de la conversión, puede ver la versión convertida ejecutando helm list.
# helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION test-convert default 1 2022-08-29 06:56:28.166918487 +0000 UTC deployed test-helmold-1
- Una vez completada la conversión, simule la liquidación de recursos. Después de la simulación, borre los recursos de la versión v2.
Espacio libre simulado:
# helm 2to3 cleanup --dry-run --tiller-out-cluster -s configmaps --name test-convert NOTE: 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]: y Helm v2 data will be cleaned up. [Helm 2] Release 'test-convert' will be deleted. [Helm 2] ReleaseVersion "test-convert.v1" will be deleted.
Espacio libre formal:
# helm 2to3 cleanup --tiller-out-cluster -s configmaps --name test-convert WARNING: "Release 'test-convert' Data" will be removed. [Cleanup/confirm] Are you sure you want to cleanup Helm v2 data? [y/N]: y Helm 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.