【发布时间】:2019-02-22 11:02:30
【问题描述】:
我在 kubernetes 中使用 schedule(8 * * * *) 创建了一个 Cronjob,作业的 backoffLimit 默认为 6,pod 的 RestartPolicy 为 Never,pod 被故意配置为 FAIL。据我了解,(对于带有restartPolicy : Never 的 podSpec)作业控制器将尝试创建 backoffLimit 数量的 pod,然后将作业标记为 Failed,因此,我预计在 Error 状态下会有 6 个 pod .
这是作业的实际状态:
status:
conditions:
- lastProbeTime: 2019-02-20T05:11:58Z
lastTransitionTime: 2019-02-20T05:11:58Z
message: Job has reached the specified backoff limit
reason: BackoffLimitExceeded
status: "True"
type: Failed
failed: 5
为什么只有 5 个失败的 pod 而不是 6 个?还是我对backoffLimit 的理解不正确?
【问题讨论】:
标签: kubernetes