Andy Haskell
Andy Haskell

Reputation: 717

How are pods in completed Kubernetes jobs deleted?

I'm running a Kubernetes job, and was trying to look at the logs for it hours after it had been completed. However, when I did kubectl describe job [jobname], no pods were listed (Events came back as just <none>), and when I did kubectl get pods, the pod for that job was not there. How would the deletion of pods in completed jobs be configured, and how could I change that to let the pod stay up longer so I can read its logs?

Upvotes: 1

Views: 1778

Answers (1)

P Ekambaram
P Ekambaram

Reputation: 17615

Look at the properties below. Below setting would keep 3 jobs in the history that were successful. You would have one failed job history. You can change the count as per your need

successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1

Upvotes: 1

Related Questions