You are viewing the documentation for an older major version of the TiDB Operator tool (TiDB Operator v1.0).

TiDB Operator v1.2, the latest major version of TiDB Operator, is now stable and recommended for general use. To view this page for TiDB Operator v1.2, click here.

Upgrade TiDB Operator and Kubernetes

This document describes how to upgrade TiDB Operator and Kubernetes.

Upgrade TiDB Operator

  1. Update CRD (Custom Resource Definition):

    kubectl apply -f<version>/manifests/crd.yaml && \
    kubectl get crd


    The <version> in this document represents the version of TiDB Operator, such as v1.0.6. You can check the currently supported version using the helm search -l tidb-operator command.

  2. Get the values.yaml file of the tidb-operator chart that you want to install:

    mkdir -p /home/tidb/tidb-operator/<version> && \
    helm inspect values pingcap/tidb-operator --version=<version> > /home/tidb/tidb-operator/<version>/values-tidb-operator.yaml
  3. Modify the operatorImage image in the /home/tidb/tidb-operator/<version>/values-tidb-operator.yaml file. Merge the customized configuration in the old values.yaml file with the /home/tidb/tidb-operator/<version>/values-tidb-operator.yaml file, and execute helm upgrade:

    helm upgrade tidb-operator pingcap/tidb-operator --version=<version> -f /home/tidb/tidb-operator/<version>/values-tidb-operator.yaml

Upgrade Kubernetes

When there is a major version upgrade of Kubernetes, you need to make sure that kubeSchedulerImageTag matches the version. By default, this value is generated by Helm during the installation or upgrade process. To reset this value, execute helm upgrade.