Kubernetes

kubectl logs

SafePod logs

kubectl logs -f <pod> -n <ns>

Shows a pod's logs; --previous shows logs before a restart.

Examples

  • kubectl logs --previous web-xyz -n prodLogs from before a crash

Syntax

kubectl logs [-f] [--previous] <pod> -n <ns>

Before you run it

Read-only.

Used when you see

Pod stuck in CrashLoopBackOff
2
Read logs from the previous crash--previous shows output from the crashed attempt.
See the whole flow →

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store