如何设置滚动更新到statefulset的超时时间?
我使用 helm,但遇到一个问题,当 pod(有状态集)进入 CrashLoopBackOff
时,它永远不会退出此状态。
即使有新的滚动更新,statefulset 仍处于与旧滚动更新相同的状态 CrashLoopBackOff
。
问题
我可以做什么来强制有状态集开始新的滚动更新(或者更好,优雅地)?
- k8s-deployment 的答案也很棒!
I use helm and I have a problem, when a pod (statefulset) is entring to CrashLoopBackOff
, it never exit this state.
Even when there is a new rolling update, the statefulset still in the same state CrashLoopBackOff
from the old rolling update.
Question
What can I do to force the statefulset to start the new rolling update (or even better, gracefully)?
- An answer for k8s-deployment will also be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过在开关中添加
--force
来强制 helm 重新创建资源,例如,这将删除并重新创建资源,包括有状态集 pod。这可能(YMMV)可以解决您的问题,也可能不会。这取决于崩溃循环的原因,因此您最好在考虑强制进行新的滚动更新之前修复该问题。或者至少在更新之前修补有状态集,使其正常运行。
You can force helm to recreate resources by adding
--force
to the switches, for exampleThis will delete and recreate the resources, including the statefulset pods. This may (YMMV) fix your problem, it may not. It depends on that cause of the crashloop, so you should ideally fix that before even considering forcing a new rolling update. Or at least patch the statefulset so it's running correctly, before doing the update.
假设之前安装成功。您需要首先通过运行
helm rollback来修复
,那么只有您使用新映像进行 helm 升级。您可以通过CrashLoopBackOff
--namespace <如果不是默认> --timeout 5m0shelm History获取修订版本列表--命名空间<如果不是默认>
。Assumed the installation was succeeded before. You need to fix the
CrashLoopBackOff
first by runninghelm rollback <release> --namespace <if not default> --timeout 5m0s <revision #>
, then only you do helm upgrade with the new image. You can get the list of revision # byhelm history <release> --namespace <if not default>
.