title | summary | category |
---|---|---|
Upgrade TiDB Operator and Kubernetes |
Learn how to upgrade TiDB Operator and Kubernetes. |
how-to |
This document describes how to upgrade TiDB Operator and Kubernetes.
-
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 asv1.1.0
. You can check the currently supported version using thehelm search -l tidb-operator
command. -
Get the
values.yaml
file of thetidb-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
-
Modify the
operatorImage
image in the/home/tidb/tidb-operator/${version}/values-tidb-operator.yaml
file. Merge the customized configuration in the oldvalues.yaml
file with the/home/tidb/tidb-operator/${version}/values-tidb-operator.yaml
file, and executehelm 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.
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.
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
.