Skip to content

CronJobs should support timezones #47202

@iterion

Description

@iterion

I couldn't find any discussion of this after searching for "cron timezone", "cronjob timezone", or "scheduledjob timezone".

The CronJob spec makes reference to https://en.wikipedia.org/wiki/Cron. That page suggests that cron would respect the timezone for a given user. The controller manager runs in a single time zone under a single user so I can't use different time zones for each job. I have jobs that run based on the schedule of external entities that observe daylight savings time. So, if I define that CronJob in UTC I will be forced to update that job from time to time (generally not something one remembers to do after just losing an hour of sleep).

I see two options for how this support might work in kubernetes:

  1. Add some new field to the CronJobSpec, like timezone: "Americas/Chicago".
  2. Use an extended cron syntax that includes timezone, e.g. 30 6 * * 1 Europe/Stockholm

Metadata

Metadata

Assignees

Labels

area/batcharea/workload-api/cronjobkind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.sig/appsCategorizes an issue or PR as relevant to SIG Apps.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions