Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 2.46 KB

upgrade-tidb-operator.md

File metadata and controls

53 lines (35 loc) · 2.46 KB
title summary category
Upgrade TiDB Operator and Kubernetes
Learn how to upgrade TiDB Operator and Kubernetes.
how-to

Upgrade TiDB Operator and Kubernetes

This document describes how to upgrade TiDB Operator and Kubernetes.

Upgrade TiDB Operator

  1. Update CRD (Custom Resource Definition):

    {{< copyable "shell-regular" >}}

    kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/${version}/manifests/crd.yaml && \
    kubectl get crd tidbclusters.pingcap.com

    Note:

    The ${version} in this document represents the version of TiDB Operator, such as v1.1.0. 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:

    {{< copyable "shell-regular" >}}

    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:

    {{< copyable "shell-regular" >}}

    helm upgrade tidb-operator pingcap/tidb-operator --version=${version} -f /home/tidb/tidb-operator/${version}/values-tidb-operator.yaml

    Note:

    After TiDB Operator is upgraded, the discovery deployment in all TiDB clusters will automatically upgrade to the specified version of TiDB Operator.

Upgrade TiDB Operator from v1.0 to v1.1 or later releases

Since TiDB Operator v1.1.0, PingCAP no longer updates or maintains the tidb-cluster chart. The components and features that have been managed using the tidb-cluster chart will be managed by CR (Custom Resource) or dedicated charts in v1.1. For more details, refer to TiDB Operator v1.1 Notes.

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.