当前位置:网站首页>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 .
边栏推荐
- MFC 给列表控件发送左键单击、双击、以及右键单击消息
- Vit (vision transformer) principle and code elaboration
- Qualitative risk analysis of Oracle project management system
- Yu Xia looks at win system kernel -- message mechanism
- shu mei pai
- Oracle time display adjustment
- 从 TiDB 集群迁移数据至另一 TiDB 集群
- Leetcode question brushing record | 203_ Remove linked list elements
- Flash return file download
- [KMP] template
猜你喜欢
[redis] Introduction to NoSQL database and redis
861. Score after flipping the matrix
Linked list interview questions (Graphic explanation)
Nacos Development Manual
Mex related learning
24. Query table data (basic)
让学指针变得更简单(三)
Database basic commands
指针和数组笔试题解析
Qualitative risk analysis of Oracle project management system
随机推荐
Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
Launch APS system to break the problem of decoupling material procurement plan from production practice
从 CSV 文件迁移数据到 TiDB
Qualitative risk analysis of Oracle project management system
Type of data in energy dashboard
备份与恢复 CR 介绍
Secure captcha (unsafe verification code) of DVWA range
Data governance: misunderstanding sorting
649. Dota2 Senate
Make learning pointer easier (3)
[Yugong series] February 2022 U3D full stack class 010 prefabricated parts
Parameter self-tuning of relay feedback PID controller
继电反馈PID控制器参数自整定
CAD ARX 获取当前的视口设置
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached
"Designer universe" APEC design +: the list of winners of the Paris Design Award in France was recently announced. The winners of "Changsha world center Damei mansion" were awarded by the national eco
07- [istio] istio destinationrule (purpose rule)
08- [istio] istio gateway, virtual service and the relationship between them
Go learning notes (3) basic types and statements (2)
Document 2 Feb 12 16:54