Migrate from Helm 2 to Helm 3

    For more information about migrating releases managed by Helm 2 to Helm 3, refer to Helm documentation.

    In this example, TiDB Operator () managed by Helm 2 is installed in the tidb-admin namespace. A basic TidbCluster and basic TidbMonitor are deployed in the tidb-cluster namespace.

    1. NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
    2. tidb-operator 1 Tue Jan 5 15:28:00 2021 DEPLOYED tidb-operator-v1.1.8 v1.1.8 tidb-admin
    1. .

      Helm 3 takes a different approach from Helm 2 in configuration and data storage. Therefore, when you install Helm 3, there is no risk of overwriting the original configuration and data.

      Note

      During the installation, do not let the CLI binary of Helm 3 overwrite that of Helm 2. For example, you can name Helm 3 CLI binary as helm3. (All following examples in this document uses helm3.)

    2. Install helm-2to3 plugin for Helm 3.

      1. helm3 plugin install https://github.com/helm/helm-2to3
      1. helm3 plugin list
      1. 2to3 0.8.0 migrate and cleanup Helm v2 configuration and releases in-place to Helm v3
    3. Migrate the releases from Helm 2 to Helm 3:

      1. helm3 2to3 convert tidb-operator

      Before you migrate, you can learn about the possible operations and their consequences by executing helm3 2to3 convert tidb-operator --dry-run.

      After the migration, you can view the release corresponding to TiDB Operator in Helm 3:

      1. helm3 list --namespace=tidb-admin

      Migrate from Helm 2 to Helm 3 - 图2Note

    4. Confirm that TiDB Operator, TidbCluster, and TidbMonitor run normally.

      To view the running status of TiDB Operator:

      If all Pods are in the Running state, TiDB Operator runs normally:

      1. NAME READY STATUS RESTARTS AGE
      2. tidb-scheduler-644d59b46f-4f6sb 2/2 Running 0 2m22s

      To view the running status of TidbCluster and TidbMonitor:

      1. watch kubectl get pods --namespace=tidb-cluster

      If all Pods are in the Running state, TidbCluster and TidbMonitor runs normally:

      1. NAME READY STATUS RESTARTS AGE
      2. basic-discovery-6bb656bfd-xl5pb 1/1 Running 0 9m9s
      3. basic-monitor-5fc8589c89-gvgjj 3/3 Running 0 8m58s
      4. basic-pd-0 1/1 Running 0 9m8s
      5. basic-tidb-0 2/2 Running 0 7m14s
      6. basic-tikv-0 1/1 Running 0 8m13s
    5. Clean up Helm 2 data, such as configuration and releases:

      Before you clean up the data, you can learn about the possible operations and their consequences by executing .

      After the cleanup, you can no longer manage the releases using Helm 2.