当前位置:网站首页>y57.第三章 Kubernetes从入门到精通 -- 业务镜像版本升级及回滚(三十)
y57.第三章 Kubernetes从入门到精通 -- 业务镜像版本升级及回滚(三十)
2022-07-05 20:11:00 【Raymond999999】
12.3 滚动更新和回滚
在指定的deployment中通过kubectl set image指定新版本的 镜像:tag 来实现更新代码的目的。
构建三个不同版本的nginx镜像,第一次使用v1版本,后组逐渐升级到v2与v3,测试镜像版本升级与回滚操作
deployment控制器支持两种更新策略:默认为滚动更新
1.滚动更新(rolling update):
滚动更新是默认的更新策略,滚动更新是基于新版本镜像创建新版本pod,然后删除一部分旧版本pod,然后再创建新版本pod,再删除一部分旧版本pod,直到就版本pod删除完成,滚动更新优势是在升级过程当中不会导致服务不可用,缺点是升级过程中会导致两个版本在短时间内会并存。
具体升级过程是在执行更新操作后k8s会再创建一个新版本的ReplicaSet控制器,在删除旧版本的ReplicaSet控制器下的pod的同时会在新版本的ReplicaSet控制器下创建新的pod,直到旧版本的pod全部被删除完后再把就版本的ReplicaSet控制器也回收掉。
在执行滚动更新的同时,为了保证服务的可用性,当前控制器内不可用的pod(pod需要拉取镜像执行创建和执行探针探测期间是不可用的)不能超出一定范围,因为需要至少保留一定数量的pod以保证服务可以被客户端正常访问,可以通过以下参数指定:
边栏推荐
- Securerandom things | true and false random numbers
- How to safely and quickly migrate from CentOS to openeuler
- 实操演示:产研团队如何高效构建需求工作流?
- Unity编辑器扩展 UI控件篇
- Common operators and operator priority
- Leetcode brush question: binary tree 13 (the same tree)
- JVMRandom不可设置种子|问题追溯|源码追溯
- MySql的root密码忘记该怎么找回
- 1: Citation;
- 2022年7月4日-2022年7月10日(ue4视频教程mysql)
猜你喜欢
leetcode刷题:二叉树14(左叶子之和)
Complete interview questions for interviewers and senior Android engineers in front-line Internet enterprises
Securerandom things | true and false random numbers
leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)
Build your own website (16)
SecureRandom那些事|真伪随机数
建立自己的网站(16)
leetcode刷题:二叉树18(最大二叉树)
How to select the Block Editor? Impression notes verse, notation, flowus
Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder
随机推荐
Fundamentals of deep learning convolutional neural network (CNN)
函数的概念及语法
nprogress插件 进度条
Some problems encountered in cocos2d-x project summary
Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
leetcode刷题:二叉树12(二叉树的所有路径)
[quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)
BZOJ 3747 POI2015 Kinoman 段树
Jvmrandom cannot set seeds | problem tracing | source code tracing
Is it safe for Galaxy Securities to open an account online?
Debezium series: record the messages parsed by debezium and the solutions after the MariaDB database deletes multiple temporary tables
Guidelines for application of Shenzhen green and low carbon industry support plan in 2023
【数字IC验证快速入门】1、浅谈数字IC验证,了解专栏内容,明确学习目标
Is it safe for CICC fortune to open an account online?
[C language] three implementations of quick sorting and optimization details
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
Process file and directory names
处理文件和目录名
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
95后阿里P7晒出工资单:狠补了这个,真香...