I recently had an event that resulted in my pod being evicted and in order to quickly reestablish service I proceeded to delete the pod which resulted in a new one being spun up.
Is there any way to describe or retrieve logs from a deleted pod so that I can perform RCA on why the pod was evicted in the first place?
From my experience, once you manually delete K8s Pod, the corresponded containers and their relevant logging data will be purged as well, thus --previous
flag works only if the previous container instance still exists in Pod.
If true, print the logs for the previous instance of the container in a pod if it exists.
You might consider in future implementing log aggregation software like Fluentd, Logspout or Logstash data collector in ELK stack.
If it is just previous one you can try --previous flag with your logs command. More details here