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

Ability to use timezones when using quartz component and CronJob strategy #5121

Closed
lsergio opened this issue Jan 30, 2024 · 4 comments · Fixed by #5664
Closed

Ability to use timezones when using quartz component and CronJob strategy #5121

lsergio opened this issue Jan 30, 2024 · 4 comments · Fixed by #5664
Assignees
Labels
good first issue Does not require full understanding of the codebase kind/feature New feature or request
Milestone

Comments

@lsergio
Copy link
Contributor

lsergio commented Jan 30, 2024

Requirement

Consider the scenario where I set up an Integration with the following endpoint:

from("quartz://groupName/timerName?cron=* 10-12 * * *&trigger.timeZone=America/Sao_Paulo")

This is supposed to run everyday from 10am to noon on Sao Paulo timezone.

As I create the integration in my cluster, it will create a CronJob with the 10-12 schedule. However, CronJobs run on the k8s node timezone, which in my case is UTC. So the integration would run with a 3-hour offset.

Problem

I would like to have my end users select the timezone they wish to run theirs jobs on, but with the limitation I will either force them to use UTC, or configure my cron trait with fallback: true to support timezone.
Using fallback: true, however, keeps the integration pod running all the time, which may waste resources.

Proposal

Since Kubernetes 1.27, CronJobs support timezone configuration in their spec, so I think we can extract that info from the quartz endpoint and use it to build the CronJob.

Open questions

No response

@lsergio lsergio added the kind/feature New feature or request label Jan 30, 2024
@squakez
Copy link
Contributor

squakez commented Jan 30, 2024

We can include the parameter in the trait configuration and let the user configure it. I'm about to rework the cron runtime in #5090 so we may have a look at this once that development is over.

@squakez
Copy link
Contributor

squakez commented Apr 5, 2024

#5090 was dropped in favor of moving the logic directly in the runtime, eventually. I think for the time being this can be developed on Camel K side while the runtimes are not fully available. @lsergio are you planning to work on this by any chance?

@squakez squakez added this to the 2.4.0 milestone Apr 5, 2024
@squakez squakez added the good first issue Does not require full understanding of the codebase label Apr 18, 2024
@lsergio
Copy link
Contributor Author

lsergio commented Jun 20, 2024

Sorry @squakez, I missed your comment in April. If we're ok with adding a field to the cron trait that will be used to create the CronJob, I can work on it.

@squakez
Copy link
Contributor

squakez commented Jun 21, 2024

Excellent, thanks @lsergio !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Does not require full understanding of the codebase kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants