Tagged articles
4 articles
Page 1 of 1
Liangxu Linux
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
How to Retrieve Crash Logs of a Restarted Pod with kubectl --previous
Open Source Linux
Open Source Linux
Jul 20, 2023 · Cloud Native

How to Retrieve Crash Logs of a Restarted Pod Using kubectl --previous

When a pod crashes and continuously restarts, standard kubelet logs may miss the previous container's output, but using kubectl logs with the --previous flag lets you access the logs of the last terminated instance, as explained with commands, file locations, and practical verification steps.

Kuberneteskubectlkubelet
0 likes · 7 min read
How to Retrieve Crash Logs of a Restarted Pod Using kubectl --previous