Delete all pods created by a cronjob

424 views
Skip to first unread message

Sergei K

unread,
Aug 29, 2018, 4:35:02 PM8/29/18
to Kubernetes user discussion and Q&A
I have a cronjob that runs every 10 minutes. So every 10 minutes, a new pod is created. After a day, I have a lot of completed pods (not jobs, just one cronjob exists). Is there way to automatically get rid of them?

Agrawal, Punit

unread,
Aug 29, 2018, 5:19:08 PM8/29/18
to kubernet...@googlegroups.com

I have a cronjob that reaps the evicted pods. You can modify it to delete the completed pods.

Have a look here - https://github.com/ptagr/pod-reaper

 

punit agrawal

dev-ops lead

new product development

ebay

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Sergei Kozyrenko

unread,
Aug 29, 2018, 7:35:24 PM8/29/18
to kubernet...@googlegroups.com
This won't really work for me as we have a lot of other long running pods. Is there a way to just get all completed pods by cronjob ID/name?
Reply all
Reply to author
Forward
0 new messages