Liangxu Linux
Jul 23, 2023 · Cloud Native
How to Retrieve Crash Logs of a Restarted Pod with kubectl --previous
When a Kubernetes pod repeatedly crashes and the container keeps restarting, the standard kubectl logs command may miss the previous instance's output, but using the --previous flag lets you fetch logs from the last terminated container by reading the symlinked files under /var/log/pods.
container crashkubectllogs
0 likes · 7 min read
