lwolf / kube-cleanup-operator

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

Cleaning up pods with "Error" status #14

Closed doubleswirve closed 6 years ago

doubleswirve commented 6 years ago

Hello -- I just deployed this tool yesterday and so far it's working pretty well. Thanks for creating this!

I did notice, however, that pods with a status of "Error" seem to stick around:

screen shot 2018-01-30 at 12 34 42 pm

Is there an option to delete pods like these as well?

I noticed the switch case here:

https://github.com/lwolf/kube-cleanup-operator/blob/master/pkg/controller/controller.go#L104

Would adding any of the other statuses (e.g., PodUnknown) allow for "Error" pods to be deleted?

https://github.com/kubernetes/api/blob/dc0dd48d5a5cae9f8736bb0643cfe6052e450f1b/core/v1/types.go#L2374

Apologies if this is out of scope for this project. Would greatly appreciate if you had any recommendations on how to delete "Error" pods (and maybe I can try implementing in my fork). Thanks again!

doubleswirve commented 6 years ago

Never mind -- I'm a dummy and wasn't using the keep-failures flag properly. Thanks!