当前位置:网站首页>Upgrade tidb operator
Upgrade tidb operator
2022-07-06 08:02:00 【Tianxiang shop】
This article describes how to upgrade TiDB Operator To the specified version . You can choose Online upgrade or Offline upgrade .
Upgrade considerations
If you use v1.3.0-beta.1 And earlier versions of TiDB Operator Span Kubernetes Cluster deployment TiDB colony , Upgrade directly TiDB Operator It will cause the cluster to roll update and enter an abnormal state . If upgrading from an earlier version TiDB Operator To v1.3, You need to do the following :
- to update CRD.
- modify TidbCluster The definition will
spec.acrossK8s
Field set totrue
. - upgrade TiDB Operator.
Abandoning Pod
ValidatingWebhook
andMutatingWebhook
. If you use v1.2 And earlier versions of TiDB Operator Deployed in the cluster Webhook, And enabled PodValidatingWebhook
andMutatingWebhook
, upgrade TiDB Operator To v1.3.0-beta.1 And later ,PodValidatingWebhook
andMutatingWebhook
Be deleted , But it won't be right TiDB Cluster management has an impact , It will not affect the running TiDB colony .
Online upgrade
If the server can access the Internet , You can follow these steps to upgrade online TiDB Operator:
upgrade TiDB Operator front , Make sure Helm repo Include what you need to upgrade TiDB Operator edition . Check... With the following command Helm repo Contains TiDB Operator edition :
helm search repo -l tidb-operator
If the output does not contain the new version you need , have access to
helm repo update
The command to update repo. Please refer to To configure Helm repo.to update Kubernetes Of CustomResourceDefinition (CRD). About CRD For more information , see also CustomResourceDefinition.
If Kubernetes Version greater than or equal to 1.16:
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd/v1/pingcap.com_tidbngmonitorings.yaml
to update CRD.
kubectl replace -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd.yaml && \ kubectl get crd tidbclusters.pingcap.com
If Kubernetes Version less than 1.16:
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd/v1beta1/pingcap.com_tidbngmonitorings.yaml
to update CRD.
kubectl replace -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd_v1beta1.yaml && \ kubectl get crd tidbclusters.pingcap.com
This article takes TiDB Operator v1.3.5 For example , You need to replace
${operator_version}
For the one you want to upgrade to TiDB Operator edition .Get what you want to upgrade
tidb-operator
chart Mediumvalues.yaml
file :mkdir -p ${HOME}/tidb-operator/v1.3.5 && \ helm inspect values pingcap/tidb-operator --version=v1.3.5 > ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
modify
${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
inoperatorImage
The image version is the version to be upgraded .If you are in the old version
values.yaml
Custom configuration is set in , Merge custom configurations into${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
in .Perform upgrade :
helm upgrade tidb-operator pingcap/tidb-operator --version=v1.3.5 -f ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
Pod After all normal starts , Run the following command to confirm TiDB Operator Mirror version :
kubectl get po -n tidb-admin -l app.kubernetes.io/instance=tidb-operator -o yaml | grep 'image:.*operator:'
If the output is similar to the result below , It means that the upgrade is successful . among ,
v1.3.5
Indicates the version number upgraded to .image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5 image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5
Be careful
TiDB Operator After the upgrade , all TiDB In the cluster
discovery
Deployment Will be automatically upgraded to the corresponding TiDB Operator edition .
Offline upgrade
If the server is not connected to the Internet , You can follow the following steps to upgrade offline TiDB Operator:
Use a machine with an Internet , Download the files and images required for the upgrade .
download TiDB Operator Needed
crd.yaml
file . About CRD For more information , see also CustomResourceDefinition.If Kubernetes Version greater than or equal to 1.16:
wget -O crd.yaml https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd.yaml
If Kubernetes Version less than 1.16:
wget -O crd.yaml https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd_v1beta1.yaml
This article takes TiDB Operator v1.3.5 For example , You need to replace
${operator_version}
For the one you want to upgrade to TiDB Operator edition .download
tidb-operator
chart Package file :wget http://charts.pingcap.org/tidb-operator-v1.3.5.tgz
download TiDB Operator Upgrade required Docker Mirror image :
docker pull pingcap/tidb-operator:v1.3.5 docker pull pingcap/tidb-backup-manager:v1.3.5 docker save -o tidb-operator-v1.3.5.tar pingcap/tidb-operator:v1.3.5 docker save -o tidb-backup-manager-v1.3.5.tar pingcap/tidb-backup-manager:v1.3.5
Upload the downloaded files and images to the server that needs to be upgraded , Follow the steps below to install on the server :
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f ./crd.yaml
For others CRD, When executing this command, it will report "AlreadyExists" Error of , You can ignore this error .
upgrade TiDB Operator Needed
crd.yaml
file :kubectl replace -f ./crd.yaml
decompression
tidb-operator
chart Package file , And copyvalues.yaml
File to upgrade directory :tar zxvf tidb-operator-v1.3.5.tgz && \ mkdir -p ${HOME}/tidb-operator/v1.3.5 && \ cp tidb-operator/values.yaml ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
install Docker Mirror to server :
docker load -i tidb-operator-v1.3.5.tar && \ docker load -i tidb-backup-manager-v1.3.5.tar
modify
${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
inoperatorImage
The image version is the version to be upgraded .If you are in the old version
values.yaml
Custom configuration is set in , Merge custom configurations into${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
in .Perform upgrade :
helm upgrade tidb-operator ./tidb-operator --version=v1.3.5 -f ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yaml
Pod After all normal starts , Run the following command to confirm TiDB Operator Mirror version :
kubectl get po -n tidb-admin -l app.kubernetes.io/instance=tidb-operator -o yaml | grep 'image:.*operator:'
If the output is similar to the result below , It means that the upgrade is successful . among ,
v1.3.5
Indicates the version number upgraded to .image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5 image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5
Be careful
TiDB Operator After the upgrade , all TiDB In the cluster
discovery
Deployment Will be automatically upgraded to the corresponding TiDB Operator edition .
边栏推荐
- [Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
- 从 CSV 文件迁移数据到 TiDB
- Data governance: metadata management
- Leetcode question brushing record | 203_ Remove linked list elements
- [research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached
- [research materials] 2021 Research Report on China's smart medical industry - Download attached
- 数据治理:微服务架构下的数据治理
- [research materials] 2021 live broadcast annual data report of e-commerce - Download attached
- 1202 character lookup
- 08- [istio] istio gateway, virtual service and the relationship between them
猜你喜欢
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
ESP系列引脚说明图汇总
A Closer Look at How Fine-tuning Changes BERT
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
Leetcode question brushing record | 203_ Remove linked list elements
[t31zl intelligent video application processor data]
【Redis】NoSQL数据库和redis简介
NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle
How to prevent Association in cross-border e-commerce multi account operations?
随机推荐
[factorial inverse], [linear inverse], [combinatorial counting] Niu Mei's mathematical problems
Helm install Minio
WebRTC系列-H.264预估码率计算
ESP系列引脚说明图汇总
Data governance: misunderstanding sorting
861. Score after flipping the matrix
What are the ways to download network pictures with PHP
The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
onie支持pice硬盘
Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation
你想知道的ArrayList知识都在这
Wireshark grabs packets to understand its word TCP segment
使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
File upload of DVWA range
Onie supports pice hard disk
Asia Pacific Financial Media | female pattern ladyvision: forced the hotel to upgrade security. The drunk woman died in the guest room, and the hotel was sentenced not to pay compensation | APEC secur
Nft智能合约发行,盲盒,公开发售技术实战--合约篇
Chinese Remainder Theorem (Sun Tzu theorem) principle and template code
[Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
让学指针变得更简单(三)