JordanZT
JordanZT

Reputation: 261

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! :)

Upvotes: 2

Views: 2544

Answers (2)

sevillo
sevillo

Reputation: 195

Edited after clarification:

You could go into the worker (kubectl get pod <pod-name> -o wide to get which one) and access the node syslogs or pods' logs. That should show you a more detailed information of what happened.

But @ho-man approach is very valid and less cumbersome.

Upvotes: 0

Ho Man
Ho Man

Reputation: 2345

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.

Upvotes: 4

Related Questions