lwolf / kube-cleanup-operator

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

be able to specify different successful/failed ttl for each pod/job #62

Closed dududko closed 3 years ago

dududko commented 3 years ago

Instead of using the global ttl configured in cleanup-operator, I would like to specify ttl more granual. Say, using the labels or annotations set ttl=1h on successful completion for job A, and specify ttl=10m for failed completion for job B.

I would like to do this using the labels kube-cleanup-operator/ttl-success: 1h and kube-cleanup-operator/ttl-fail: 10m.

Why is it important ? For some releases it is very important to read and analyze logs before removing pods or jobs, but for other is it not so important. This is why in many cases you need to specify different ttl for each job, or use the default value from the cleanup-operator.

lwolf commented 3 years ago

Using annotations for this fine-tuning was the plan from the beginning, but nobody asked for it, so I kept it simple. I'll look into the implications of adding it, when I have cycles to work on it.

Thanks

lwolf commented 3 years ago

closing this in favor of https://github.com/lwolf/kube-cleanup-operator/issues/72