K8S: Back-off restarting failed container 解决办法
版权
| 遇到的问题 | [root@node-16 software]# kubectl describe pods cephfs-deployment001-5c46c88595-zfgx2 ------------------------------------------------------------------------------------------------------------------ ---- ------ ---- ---- ------- Normal Scheduled <unknown> default-scheduler Successfully assigned default/cephfs-deployment001-5c46c88595-zfgx2 to node-16 Normal Pulling 7s (x4 over 51s) kubelet, node-16 Pulling image "10.83.35.11/web/cephfs01-deployment:latest" Normal Pulled 7s (x4 over 51s) kubelet, node-16 Successfully pulled image "10.83.35.11/web/cephfs01-deployment:latest" Normal Created 7s (x4 over 51s) kubelet, node-16 Created container cephfs-deployment001 Normal Started 6s (x4 over 51s) kubelet, node-16 Started container cephfs-deployment001 Warning BackOff 5s (x6 over 49s) kubelet, node-16 Back-off restarting failed container |
| 解决办法 | 在deployment 镜像的后面加上命令 command: [ "/bin/bash", "-ce", "tail -f /dev/null" ] |
| 修改yam |
|
| 查看运 |
本文介绍了解决Kubernetes环境中容器不断重启的问题。通过在Deployment配置中为镜像添加特定命令,确保容器能正常运行,避免因退出而被Kubernetes反复重启。

1678

被折叠的 条评论
为什么被折叠?



