I got Pod errors: CrashLoopBackOff from kubernetes

2019-08-22 08:56发布

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?

2条回答
Viruses.
2楼-- · 2019-08-22 09:30

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"
查看更多
做自己的国王
3楼-- · 2019-08-22 09:32

Just modify your deployment as follows:

   spec:
     containers:
     - image: YOUR_IMAGE
       name: NAME
       tty: true     #add this line
查看更多
登录 后发表回答