在 statefulset 中跳过 pod 部署

Skipping a pod deployment in statefulset

我有一组有状态的 pods,由于它们的有状态性质,其中一个无法重新创建,因为一些状态错误导致删除它无济于事。

因为它是一个有状态集,所以 kubernetes 将阻止创建额外的 pods,直到它能够获得卡住的 运行。 Statefulsets 有 podManagementPolicy:"Parallel" 但它不能在运行时更改。

问题是有没有办法让kubernetes跳过卡住的?

我相信您正在为一个已知的 issue 寻找 WA,它仍然开放

StatefulSet 将继续等待损坏的 Pod 变为就绪状态(这永远不会发生),然后再尝试将其恢复到工作配置。

在升级方面在 git hub below from official doc

上找到了这个

StatefulSet中的Pods按照倒序更新。 StatefulSet 控制器终止每个 Pod,并等待它转换到 运行 并在更新下一个 Pod 之前就绪。

Note that, even though the StatefulSet controller will not proceed to update the next Pod until its ordinal successor is Running and Ready, it will restore any Pod that fails during the update to its current version. Pods that have already received the update will be restored to the updated version, and Pods that have not yet received the update will be restored to the previous version. In this way, the controller attempts to continue to keep the application healthy and the update consistent in the presence of intermittent failures.

阅读Forced Rollback

在默认 Pod 管理策略 (OrderedReady) 中使用滚动更新时,可能会进入需要手动干预修复的损坏状态