K8S: Back-off restarting failed container 解决办法
遇到的问题 | [[email protected] 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 |
|
查看运行结果 |
[[email protected] 2020.7.3]# kubectl get pods |grep cephfs-deployment
[[email protected] 2020.7.3]# kubectl describe pods cephfs-deployment-0001-7c4bd754d6-59qzk ------------------------------------------------------------------------------- QoS Class: BestEffort |