I'm a senior DevOps engineer with a background in backend development, and I'm curious about how others in the community manage evicted pods in their Kubernetes clusters. I've been considering setting up a Kubernetes cron job to handle the cleanup of these evicted pods. We're currently using AWS EKS with Kubernetes version 1.32. I'd love to hear your experiences and thoughts on this!
2 Answers
I personally use the descheduler for this purpose. It's super handy, just make sure to configure it correctly!
Yeah, it works really well! Just be careful with the configurations.
Kubernetes actually cleans up evicted pods on its own most of the time. What kind of cleanup are you specifically thinking about that it doesn't handle?
I've noticed that in earlier Kubernetes versions, I had to manually clean up dead pods, especially when they were left over after some memory-intensive tasks. Now I generally ensure I have limits set, so I don't run into that.
You might have to wait for garbage collection to kick in, but I've often ended up having to manually clear them myself before that happens.

Absolutely! I do the same—just adjusting the settings can make a big difference.