K8S POD无限重启
报错Back-off restarting failed container

原因

由于启动容器后,容器内部没有常驻的前台进程,导致容器启动成功后即退出,从而进行了持续的重启。
例如ubuntu这类操作系统容器,nginx这种默认后台执行的容器

解决

  • 操作系统容器增加启动命令配置,例如
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
  • 默认后台运行容器改为前台运行,例如
command : [ "nginx", "-g", "daemon off;"]

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2021-07-18
  • 2022-03-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-10-09
  • 2021-08-07
  • 2021-08-11
  • 2021-06-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
相关资源
相似解决方案