kubectl logs

The kubectl command that prints what a container wrote to its standard output and standard error.

In more detail

With --previous it shows the output of the last run before a restart, which is where a crash usually explains itself. Use -c to pick one container when a pod has several. Logs only exist once a process has run, so they are empty for image pull failures.

Example

kubectl logs web --previous

Related terms

Taught in

References

Certification courses