在 StatefulSet 中,如果 Pod 由于 ImagePullBackOff 而不断失败,它们会继续尝试多长时间?

In StatefulSet, how long does the pod keep trying to if they keep on failing due to ImagePullBackOff?

我有一个 Kubernetes 集群,我正在研究 Kubernetes pod 在发生故障时的行为。

所以在我的单主 2 工作节点 Kubernetes 集群中,部署了一个 StatefulSet。如果我通过将 StatefulSet 规范中的 pod 图像更改为不存在的版本并考虑策略类型是 RollingUpdate 来注入故障(有意),我看到 pod 一直在尝试 hours/days 创建容器并且没有'停止这种努力。 Kubernetes中是否有配置让K8s在这种情况下采取行动?

sample-0   1/1    Running            0         23h  worker1
sample-1   0/1    ImagePullBackOff   0         23h  worker2   

遗憾的是,后退不可调整。

来自 Kubernetes 官方文档:

The BackOff part indicates that Kubernetes will keep trying to pull the image, with an increasing back-off delay.

Kubernetes raises the delay between each attempt until it reaches a compiled-in limit, which is 300 seconds (5 minutes).

参考:https://kubernetes.io/docs/concepts/containers/images/#imagepullbackoff

https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy