Open lwolf opened 3 years ago
The main idea behind using labels is an option to use LabelSelector on ListFunc
and WatchFunc
. So it looks like that implementing labelSelector does not contradicts with annotation-based logic in general, but the same logic could be implemented with FieldSelector on annotations. Any way, solution with annotations could be done in this way:
--respect-annotations
with false by default for compatibilitykube-cleanup-operator.lwolf.github.com/disabled
to disable cleanup for the specific class of pods/jobs for debugging purposes.delete-successful-after
, delete-failed-after
delete-orphaned-after
, delete-evicted-after
, delete-pending-after
I agree that labelSelector
doesn't contradict annotation-based logic. Merged the PR.
Your plan for the annotations looks great.
The only thing I'd change is the prefix for the annotations: kleaner.lwolf.org
instead of kube-cleanup-operator.lwolf.github.com/
.
There is a use case when jobs/pods need to be "cleaned up" after a different timeout. It should be possible to support it by considering annotations on pods/jobs before making a "clean up" decision.
https://github.com/lwolf/kube-cleanup-operator/pull/71#issuecomment-804241375