Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for annotation-based customizations #72

Open
lwolf opened this issue Mar 22, 2021 · 2 comments · May be fixed by #74
Open

Add support for annotation-based customizations #72

lwolf opened this issue Mar 22, 2021 · 2 comments · May be fixed by #74

Comments

@lwolf
Copy link
Owner

lwolf commented Mar 22, 2021

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.

#71 (comment)

@RocketRaccoon
Copy link
Contributor

RocketRaccoon commented Mar 22, 2021

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:

  1. Support configuration option like --respect-annotations with false by default for compatibility
  2. Add at least main annotation which disables cleanup on exact job/pod kube-cleanup-operator.lwolf.github.com/disabled to disable cleanup for the specific class of pods/jobs for debugging purposes.
  3. Support configurable options for jobs/pods delete-successful-after, delete-failed-after
  4. Support pods only configuration delete-orphaned-after, delete-evicted-after, delete-pending-after

@lwolf
Copy link
Owner Author

lwolf commented Mar 28, 2021

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/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants