How to see CrashLoopBackOff logs in kubernetes

12/6/2019

I have an error in 1 of my docker container that makes a CrashLoopBackOff.

The same code work on the localhost so I guess its something to do with the env.

the problem is I can't manage to see any logs.

I have tried with

kubetail mypod

kubectl logs mypod

kubtctl logs --previous mypod

are there any more methods I can try in order to see what's the problem?

-- Amit Wagner
kubectl
kubernetes

1 Answer

12/6/2019

try describing pod using following command:

kubectl describe pod <pod-name> -n <namespace-name>

I am suspecting it might have to do something with your readiness/liveness probes.

You can also check events in namespace using:

kubectl get events -n <namespace-name>
-- Rajat Jindal
Source: StackOverflow