【k8s】deploy-progressDeadlineSeconds
环境
- kubernetes 1.20.4
- Spring Boot 2.5.0-M3
目标
deploy 升级过程中的最大时间由 progressDeadlineSeconds 来定义。
如果升级过程被暂停了,该时间也会同步暂停,时间不会一直增长。
示例
Deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: busybox
spec:
progressDeadlineSeconds: 3
selector:
matchLabels:
app: busybox
replicas: 18
template:
metadata:
labels:
app: busybox
spec:
terminationGracePeriodSeconds: 5
containers:
- name: busybox
image: busybox:1.30.0
command: ["/bin/sh", "-c", "sleep 3600"]
查看
[root@master ~]# kubectl get pod
NAME READY STATUS RESTARTS AGE
busybox-6bd65c67cf-2lq2x 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-44j46 1/1 Running 0 35s
busybox-6bd65c67cf-4hchv 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-bll7f 1/1 Running 0 35s
busybox-6bd65c67cf-hm7n7 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-jd7w9 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-jf5s9 1/1 Running 0 35s
busybox-6bd65c67cf-m47zs 1/1 Running 0 35s
busybox-6bd65c67cf-m9cl4 1/1 Running 0 35s
busybox-6bd65c67cf-nm8wt 1/1 Running 0 35s
busybox-6bd65c67cf-qdsmq 1/1 Running 0 35s
busybox-6bd65c67cf-rnpgl 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-s4nnx 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-sp87l 1/1 Running 0 35s
busybox-6bd65c67cf-trbrv 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-vjct8 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-vspqb 0/1 ContainerCreating 0 35s
busybox-6bd65c67cf-zljwk 0/1 ContainerCreating 0 35s
查看状态
[root@master ~]# kubectl rollout status deployment busybox
Waiting for deployment "busybox" rollout to finish: 4 of 18 updated replicas are available...
Waiting for deployment "busybox" rollout to finish: 5 of 18 updated replicas are available...
Waiting for deployment "busybox" rollout to finish: 6 of 18 updated replicas are available...
Waiting for deployment "busybox" rollout to finish: 7 of 18 updated replicas are available...
Waiting for deployment "busybox" rollout to finish: 8 of 18 updated replicas are available...
error: deployment "busybox" exceeded its progress deadline
可以看到超过最大时间没有升级完成,就会变成超时状态。
总结
progressDeadlineSeconds 定义 deploy 升级的最大时间。
附录
分类:
Kubernetes
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!