drupalwxt / helm-drupal

Helm chart for running Drupal on Kubernetes
https://drupalwxt.github.io/helm-drupal/index.yaml
MIT License
30 stars 22 forks source link

Cron jobs and timezone #129

Closed kieran-github closed 3 weeks ago

kieran-github commented 2 years ago

Hello,

I had some questions regarding setting the time zone for running our cronjobs as we have some that are time-sensitive and are subject to daylight savings changes. For example, if we wish to run a cronjob at 8:30AM everyday, depending on whether it's EST or EDT we will need to adjust the schedule by one hour as kubernetes runs on UTC0 which doesn't account for such thing.

I had tried to change the alpine containers timezone to EST using tzdata, and the associated schedules to EST / EDT. This works - however, the cronjobs still run at UTC time even though the container are in EST.

Does this mean the kubernetes cron controller (or whatever kicks off the cronjobs from the kubernetes level) is starting the crons in their UTC timezone regardless of container timezone?

zachomedia commented 2 years ago

Unfortunately Kubernetes does not support timezones at this time in CronJobs. However, Kubernetes 1.24 will be adding a timezone field in cron jobs, at which time you will be able to specify the timezone (https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.24.md).