当前位置:网站首页>灰度升级 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}
边栏推荐
- datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
- ROS learning (IX): referencing custom message types in header files
- Asia Pacific Financial Media | art cube of "designer universe": Guangzhou community designers achieve "great improvement" in urban quality | observation of stable strategy industry fund
- Pangolin Library: control panel, control components, shortcut key settings
- 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
- Machine learning - decision tree
- Google may return to the Chinese market after the Spring Festival.
- [Yugong series] creation of 009 unity object of U3D full stack class in February 2022
- 实现精细化生产, MES、APS、ERP必不可少
- 49. Sound card driven article collection
猜你喜欢
![[t31zl intelligent video application processor data]](/img/67/b77c1de990d9b8868f8df5e55b0227.png)
[t31zl intelligent video application processor data]

Go learning notes (3) basic types and statements (2)

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

Golang DNS 随便写写
![[1. Delphi foundation] 1 Introduction to Delphi Programming](/img/14/272f7b537eedb0267a795dba78020d.jpg)
[1. Delphi foundation] 1 Introduction to Delphi Programming

解决方案:智慧工地智能巡檢方案視頻監控系統

NFT smart contract release, blind box, public offering technology practice -- contract

opencv学习笔记九--背景建模+光流估计

C语言自定义类型:结构体

Epoll and IO multiplexing of redis
随机推荐
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
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
Data governance: data quality
xpath中的position()函数使用
Generator Foundation
软件开发的一点随记
Vit (vision transformer) principle and code elaboration
Parameter self-tuning of relay feedback PID controller
Make learning pointer easier (3)
[redis] Introduction to NoSQL database and redis
opencv学习笔记八--答题卡识别
Risk planning and identification of Oracle project management system
Opencv learning notes 8 -- answer sheet recognition
将 NFT 设置为 ENS 个人资料头像的分步指南
CAD ARX gets the current viewport settings
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
The Vice Minister of the Ministry of industry and information technology of "APEC industry +" of the national economic and information technology center led a team to Sichuan to investigate the operat
edge浏览器 路径获得
MFC 给列表控件发送左键单击、双击、以及右键单击消息
Learn Arduino with examples