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
See the whole flow →Read logs from the previous crash--previous shows output from the crashed attempt.
Related commands
- kubectl describeDescribe resource/events
- docker logsContainer logs
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store