成功最有效的方法就是向有经验的人学习!

deployment-progressDeadlineSeconds

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 升级的最大时间。

赞(0) 打赏
未经允许不得转载:陈桂林博客 » deployment-progressDeadlineSeconds
分享到

大佬们的评论 抢沙发

全新“一站式”建站,高质量、高售后的一条龙服务

微信 抖音 支付宝 百度 头条 快手全平台打通信息流

橙子建站.极速智能建站8折购买虚拟主机

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册