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

[REQ] CronJob/Crontab based image cleanup #1055

Open
1 task done
justusbunsi opened this issue Jul 19, 2024 · 5 comments
Open
1 task done

[REQ] CronJob/Crontab based image cleanup #1055

justusbunsi opened this issue Jul 19, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@justusbunsi
Copy link

What kind of request is this?

New feature

What is your request or suggestion?

Hi. First things first: This project saves me a ton of time and headache. Thank you for maintaining it. 👍

Would you be open to supporting cronjob/crontab based image cleanup? This would decouple the controller behavior from its maintenance.

To give some context to my request:

Right now, the image cleanup execution relies on two things:

  • when the controller-manager starts
  • when the configured scheduling interval and delay matches

Configured correctly and started outside of main working hours, this concept works quite well to remove unused/outdated CI images from worker nodes. When updating or restarting the controller-manager (preferably during work hours), the interval and delay gets out of sync with desired cleanup time. Based on the defined interval, this can lead to unnecessary additional image pulls during working hours and increases build times.

Are you willing to submit PRs to contribute to this feature request?

  • Yes, I am willing to implement it.
@justusbunsi justusbunsi added the enhancement New feature or request label Jul 19, 2024
@ashnamehrotra
Copy link
Contributor

@justusbunsi Do you mean using a CronJob to schedule Eraser's ImageJob or have an option to eliminate ImageJobs? Without ImageJobs we will not be able to schedule an eraser pod on each node and watch eraser resources. We treat ImageJobs as a combination of daemonset and cronjob - allowing us to schedule a pod on each node while ensuring we can repeat and run jobs to completion.

@justusbunsi
Copy link
Author

Hi @ashnamehrotra. I mean having something like manager.scheduling.cron: "0 2 * * *" as an alternative to manager.scheduling.repeatInterval. The current repeat interval is not predictable as each controller will reset that interval.

@ashnamehrotra
Copy link
Contributor

@justusbunsi got it, yes I think would be very useful!

@justusbunsi
Copy link
Author

I'll give it a try. 🙂

@stevekuznetsov
Copy link

For our use-case, it would be incredibly useful to be able to use PodFailurePolicy to allow image jobs to be resilient to pod phases.

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

No branches or pull requests

3 participants