How to see logs of terminated pods

Running kubectl logs -p will fetch logs from existing resources at API level. This means that terminated pods’ logs will be unavailable using this command.

As mentioned in other answers, the best way is to have your logs centralized via logging agents or directly pushing these logs into an external service.

Alternatively and given the logging architecture in Kubernetes, you might be able to fetch the logs directly from the log-rotate files in the node hosting the pods. However, this option might depend on the Kubernetes implementation as log files might be deleted when the pod eviction is triggered.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)