当前位置:网站首页>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以保证服务可以被客户端正常访问,可以通过以下参数指定:
边栏推荐
- Process file and directory names
- Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
- 函数的概念及语法
- Build your own website (16)
- Relationship between floating elements and parent and brother boxes
- .Net分布式事务及落地解决方案
- 图嵌入Graph embedding学习笔记
- sun. misc. Base64encoder error reporting solution [easy to understand]
- [C language] string function and Simulation Implementation strlen & strcpy & strcat & StrCmp
- 深度学习 卷积神经网络(CNN)基础
猜你喜欢
Scala基础【HelloWorld代码解析,变量和标识符】
leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)
秋招字节面试官问你还有什么问题?其实你已经踩雷了
Oracle-表空间管理
js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
实操演示:产研团队如何高效构建需求工作流?
Redis cluster simulated message queue
Parler de threadlocal insecurerandom
S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
走入并行的世界
随机推荐
港股将迎“最牛十元店“,名创优品能借IPO突围?
S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
[quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)
JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
期货如何网上开户?安不安全?
ACM getting started Day1
Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
Complete interview questions for interviewers and senior Android engineers in front-line Internet enterprises
Cocos2d-x项目总结中的一些遇到的问题
sun.misc.BASE64Encoder报错解决方法[通俗易懂]
Go language | 02 for loop and the use of common functions
实操演示:产研团队如何高效构建需求工作流?
中金财富在网上开户安全吗?
Leetcode skimming: binary tree 16 (path sum)
淺淺的談一下ThreadLocalInsecureRandom
14. Users, groups, and permissions (14)
C - sequential structure
c語言oj得pe,ACM入門之OJ~
c——顺序结构