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

Feature request: Time zone support for CronJobs #388

Open
sjerdo opened this issue Nov 1, 2024 · 1 comment
Open

Feature request: Time zone support for CronJobs #388

sjerdo opened this issue Nov 1, 2024 · 1 comment

Comments

@sjerdo
Copy link

sjerdo commented Nov 1, 2024

Currently, CronJob schedule expressions are all considered to be UTC, except for in-pod cron jobs which follow the timezone of the service

For one of our projects, we'd like to run a specific cron just after midnight (local time). But we cannot configure that, since this expression does not considers daylight saving time. 0 23 * * * will run at 00:00 AM CET or 01:00 CEST.

https://docs.lagoon.sh/concepts-basics/lagoon-yml/#cron-job-example

Timezones:
The default timezone for cron jobs is UTC.
Native cron jobs use the timezone of the node, which is UTC.
In-pod cron jobs use the timezone of the defined service, which can be configured to something other than UTC.

Kubernetes supports CronJob syntax with timezone support since v1.27: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones

Can you support specifying a time zone for CronJobs in .lagoon.yml ?

@shreddedbacon
Copy link
Member

The only problem is that if the timezone is set, and the frequency means it lands as an in-pod cronjob, we won't do anything with the timezone. We can document this as a caveat though. The addition of the field seems simple enough though, will see what the rest of the team thinks.

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

No branches or pull requests

2 participants