Upgrade TiDB Operator and Kubernetes
This document describes how to upgrade TiDB Operator and Kubernetes.
Upgrade TiDB Operator
Update CRD (Custom Resource Definition):
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/<version>/manifests/crd.yaml && \ kubectl get crd tidbclusters.pingcap.comGet the
values.yamlfile of thetidb-operatorchart 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.yamlModify the
operatorImageimage in the/home/tidb/tidb-operator/<version>/values-tidb-operator.yamlfile. Merge the customized configuration in the oldvalues.yamlfile with the/home/tidb/tidb-operator/<version>/values-tidb-operator.yamlfile, and executehelm 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.