I'm running Apache Airflow on a Kubernetes cluster and I'm facing an issue with retrieving logs from deleted pods. I can easily get logs from currently running or recently terminated pods using kubectl logs, but I'm unable to get logs from older, deleted pods.
My versions
awswrangler==2.19.0
apache-airflow-providers-cncf-kubernetes==4.3.0
apache-airflow-providers-amazon==5.0.0
boto3==1.24.56
gnupg==2.3.1
PyYAML==6.0
Here's what I've tried:
# This works fine and gives me the actual log
kubectl logs my-current-pod-239847283947
# This doesn't work for an old, deleted pod
kubectl logs my-old-pod-928374928374
The second command returns the following error:
The error
Error from server (NotFound): pods "my-old-pod" not found
I understand that the pod is deleted, but is there a way to retrieve its logs or at least configure Airflow or Kubernetes to save these logs for future reference?
NOTE: I'm using AWS for storage
Any help would be greatly appreciated!