k8s启动容器报错:“Back-off restarting failed container“的解决办法
前言当k8s启动容器时,如果配置文件有误,会出现"Back-off restarting failed container"的报错信息更正配置形如1... ...spec:containers:# 添加如下两行内容imagePullPolicy: IfNotPresentcommand: [ "/bin/sh", "-c", "--" ]args: [ "shile true; do sleep
·
前言
当k8s启动容器时,如果配置文件有误,会出现"Back-off restarting failed container"的报错信息
更正配置
形如1
... ...
spec:
containers:
# 添加如下两行内容
imagePullPolicy: IfNotPresent
command: [ "/bin/sh", "-c", "--" ]
args: [ "shile true; do sleep 30; done;" ]
... ...
形如2
... ...
spec:
containers:
# 添加如下两行内容
imagePullPolicy: IfNotPresent
command: [ "/bin/bash", "-ce", "tail -f /dev/null" ]
... ...
形如3
... ...
spec:
containers:
# 添加如下两行内容
imagePullPolicy: IfNotPresent
restartPolicy: Never
command:
- /bin/sh
- "-c"
- "sleep 60m"
... ...
结语
… …
更多推荐
已为社区贡献25条内容
所有评论(0)