I got Pod errors: CrashLoopBackOff from kubernetes

旧巷老猫 提交于 2019-12-20 07:11:10

问题


I was trying to run simple python file on kubenetes engine. while i got following error message "Pod errors: CrashLoopBackOff". How to fix this issue?


回答1:


The issue caused by the docker container which exits as soon as the "start" process finishes. Add a command that runs forever and probably it'll work. For example, recreating docker image:

#Dockerfile
[...]
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"



回答2:


Just modify your deployment as follows:

   spec:
     containers:
     - image: YOUR_IMAGE
       name: NAME
       tty: true     #add this line


来源:https://stackoverflow.com/questions/49974003/i-got-pod-errors-crashloopbackoff-from-kubernetes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!