kuberneteskubernetes-pod

How can I access the pod when it become CrashLoopBackOff?


Right now, I deployed some pods on my kubernetes cluster. But sometime, my image may has some bugs which make the pod cannot start correctly.

For example: nats-1 0/1 CrashLoopBackOff 121 10h

I also cannot see any error in the kubectl log.

So is there any way to access this pod? Or is there any tools or tech can allow to to enter the container?

Thanks a lot all! :)


Solution

  • You can kubectl describe to get the events, it sometimes might show some errors there. Otherwise you can probably also make the deployment/pod run a command like sleep 3600 to keep it open for you to exec into it to investigate further.