FahamLah

Commands

kubectl logs

kubectl logs <pod|deploy/name> [-c container] [--previous] [-f] [--tail=n]

Risk: Safe

What it does

Shows what a container printed.

When to use it

When an app crashes: --previous shows the run that crashed.

Example

$ kubectl logs deployment/oops --previous

What did it say before it crashed?