当前位置:网站首页>灰度升级 TiDB Operator
灰度升级 TiDB Operator
2022-07-06 07:58:00 【添香小铺】
如果你希望升级 TiDB Operator 至新版本,同时希望控制升级的影响范围,避免对整个 Kubernetes 集群中的所有 TiDB 集群产生不可预知的影响,可以采用灰度升级的方式升级 TiDB Operator。使用灰度升级后,你可以在灰度部署的集群中确认 TiDB Operator 升级的影响,在确认 TiDB Operator 新版本稳定工作后,再正常升级 TiDB Operator。
TiDB Operator 目前只支持对部分组件进行灰度升级,即 tidb-controller-manager 和 tidb-scheduler,不支持对增强型 StatefulSet 控制器和准入控制器进行灰度升级。
在使用 TiDB Operator 时,tidb-scheduler 并不是必须使用。你可以参考 tidb-scheduler 与 default-scheduler,确认是否需要部署 tidb-scheduler。
第 1 步:为当前 TiDB Operator 配置 selector 并执行升级
在当前 TiDB Operator 的 values.yaml 中,添加如下 selector 配置:
controllerManager: selector: - version!=canary
参考在线升级或离线升级,对当前 TiDB Operator 执行升级步骤:
helm upgrade tidb-operator pingcap/tidb-operator --version=${chart_version} -f ${HOME}/tidb-operator/values-tidb-operator.yaml
第 2 步:部署灰度的 TiDB Operator
参考在线部署 TiDB Operator 的第 1 步和第 2 步,获取想要部署的灰度版本 TiDB Operator 的
values.yaml文件,并在values.yaml中添加如下配置。controllerManager: selector: - version=canary appendReleaseSuffix: true #scheduler: # create: false # 如果你不需要 `tidb-scheduler`,将这个值设置为 false advancedStatefulset: create: false admissionWebhook: create: falseappendReleaseSuffix需要设置为true。如果不需要灰度升级 tidb-scheduler,可以设置
scheduler.create: false。如果需要灰度升级 tidb-scheduler,配置scheduler.create: true,会创建一个名字为{ { .scheduler.schedulerName }}-{ {.Release.Name}}的 scheduler。如果要在灰度部署的 TiDB Operator 中使用这个 scheduler,需要配置 TidbCluster CR 中的spec.schedulerName为这个 scheduler 的名字。由于灰度升级不支持增强型 StatefulSet 控制器和准入控制器,必须配置
advancedStatefulset.create: false和admissionWebhook.create: false。如需了解灰度部署相关参数的详细信息,可参考使用多套 TiDB Operator 单独管理不同的 TiDB 集群 - 相关参数。
在不同的 namespace 中(例如
tidb-admin-canary),使用不同的 Helm Release Name(例如helm install tidb-operator-canary ...)部署灰度的 TiDB Operator:helm install tidb-operator-canary pingcap/tidb-operator --namespace=tidb-admin-canary --version=${operator_version} -f ${HOME}/tidb-operator/${operator_version}/values-tidb-operator.yaml将
${operator_version}替换为你需要灰度升级到的 TiDB Operator 版本号。
第 3 步:测试灰度的 TiDB Operator (可选)
在正常升级 TiDB Operator 前,可以测试灰度部署的 TiDB Operator 是否稳定工作。支持测试的组件有 tidb-controller-manager 和 tidb-scheduler。
如果需要测试灰度部署的 tidb-controller-manager,可通过如下命令,为某个 TiDB 集群设置 label:
kubectl -n ${namespace} label tc ${cluster_name} version=canary通过查看已经部署的两个 tidb-controller-manager 的日志,可以确认这个设置 label 的 TiDB 集群已经由灰度部署的 TiDB Operator 管理。查看日志的步骤如下:
查看当前 TiDB Operator 的 tidb-controller-manager 的日志:
kubectl -n tidb-admin logs tidb-controller-manager-55b887bdc9-lzdwv预期的输出如下:
I0305 07:52:04.558973 1 tidb_cluster_controller.go:148] TidbCluster has been deleted tidb-cluster-1/basic1查看灰度部署的 TiDB Operator 的 tidb-controller-manager 的日志:
kubectl -n tidb-admin-canary logs tidb-controller-manager-canary-6dcb9bdd95-qf4qr预期的输出如下:
I0113 03:38:43.859387 1 tidbcluster_control.go:69] TidbCluster: [tidb-cluster-1/basic1] updated successfully
如果需要测试灰度部署的 tidb-scheduler,可通过如下命令,为某个 TiDB 集群修改
spec.schedulerName为tidb-scheduler-canary:kubectl -n ${namespace} edit tc ${cluster_name}修改后,集群内各组件会滚动升级,通过查看灰度部署的 TiDB Operator 的
tidb-scheduler的日志,可以确认集群已经使用灰度tidb-scheduler:kubectl -n tidb-admin-canary logs tidb-scheduler-canary-7f7b6c7c6-j5p2j -c tidb-scheduler测试完成后,可撤销前两步中的修改,重新使用当前的 TiDB Operator 来管理 TiDB 集群。
kubectl -n ${namespace} label tc ${cluster_name} version-kubectl -n ${namespace} edit tc ${cluster_name}
第 4 步:正常升级 TiDB Operator
确认灰度部署的 TiDB Operator 已经正常工作后,可以正常升级 TiDB Operator。
删除灰度部署的 TiDB Operator:
helm -n tidb-admin-canary uninstall ${release_name}
边栏推荐
- 【云原生】手把手教你搭建ferry开源工单系统
- A Closer Look at How Fine-tuning Changes BERT
- Parameter self-tuning of relay feedback PID controller
- 649. Dota2 Senate
- Google may return to the Chinese market after the Spring Festival.
- NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle
- Data governance: misunderstanding sorting
- 指针和数组笔试题解析
- Data governance: metadata management
- Opencv learning notes 9 -- background modeling + optical flow estimation
猜你喜欢

让学指针变得更简单(三)

Uibehavior, a comprehensive exploration of ugui source code

Pangolin Library: control panel, control components, shortcut key settings

"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa

【云原生】手把手教你搭建ferry开源工单系统
![[t31zl intelligent video application processor data]](/img/67/b77c1de990d9b8868f8df5e55b0227.png)
[t31zl intelligent video application processor data]
![[cf gym101196-i] waif until dark network maximum flow](/img/66/6b339fc23146b5fbdcd2a1fa0a2349.png)
[cf gym101196-i] waif until dark network maximum flow

【T31ZL智能视频应用处理器资料】

Interview Reply of Zhuhai Jinshan

Qualitative risk analysis of Oracle project management system
随机推荐
861. Score after flipping the matrix
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
上线APS系统,破除物料采购计划与生产实际脱钩的难题
File upload of DVWA range
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
Database addition, deletion, modification and query
数据治理:微服务架构下的数据治理
23. Update data
Data governance: 3 characteristics, 4 transcendence and 3 28 principles of master data
24. Query table data (basic)
Risk planning and identification of Oracle project management system
onie支持pice硬盘
数据治理:数据质量篇
. Net 6 learning notes: what is NET Core
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
Solution: système de surveillance vidéo intelligent de patrouille sur le chantier
Easy to use tcp-udp_ Debug tool download and use
Esrally domestic installation and use pit avoidance Guide - the latest in the whole network