lwolf / kube-cleanup-operator

Kubernetes Operator to automatically delete completed Jobs and their Pods
MIT License
503 stars 109 forks source link

Clean up orphaned jobs #38

Closed punya closed 4 years ago

punya commented 4 years ago

When the cluster scales down, some pods are deleted because their nodes are deleted. If the jobs controlling those pods have completed, they stick around and never get deleted. As a result, kubectl commands and the dashboard UI slow down over time.

This operator should include those “orphaned” jobs when it does its periodic cleanup.

lwolf commented 4 years ago

Thanks, it should definitely be added.

lwolf commented 4 years ago

Could you try the new 0.7 version and let me know if it works in your case? https://github.com/lwolf/kube-cleanup-operator/releases/tag/v0.7.0

It now has separate loops for jobs and pods to make sure that everything gets cleaned properly.

Make sure to run it with -legacy-mode=false to be able to use this feature.

punya commented 4 years ago

Thanks for the enhancement! Unfortunately we have moved to using pods instead of jobs for our implementation, so we won’t be able to test this feature in our system.