Users may want to have a periodically scheduled job that runs regularly on interval, except for some explicitly defined time ranges. For example, we may want to specify that during deploy freezes or some other real-world event, a cron job should not be run.
Users should be able to specify a list of time ranges (start and end time, inclusive), during which schedules are not allowed.
API Design
apiVersion: execution.furiko.io/v1alpha1
kind: JobConfig
metadata:
name: my-job-config
namespace: my-namespace
spec:
schedule:
# Schedule every hour from 10AM to 6PM.
cron:
expression: 0 10-18 * * *
timezone: Asia/Singapore
constraints:
# Example of multiple notDuring freeze periods, inclusive.
notDuring:
- start: 2022-04-01T00:00:00+08:00
end: 2022-04-02T11:59:59+08:00
- start: 2022-04-28T00:00:00+08:00
end: 2022-04-28T15:59:59+08:00
Using the above example:
On 1st April, no schedules will be created at all.
On 2nd April, the first schedule that day will be at 12:00:00.
On 28th April, the first schedule that day will be at 16:00:00.
Possible Extensions
Sharing constraints across multiple JobConfigs
Regular constraints instead of fixed time range: Using a cron expression to define exclusions to the main cron schedule, similar to GitLab
Users may want to have a periodically scheduled job that runs regularly on interval, except for some explicitly defined time ranges. For example, we may want to specify that during deploy freezes or some other real-world event, a cron job should not be run.
Users should be able to specify a list of time ranges (start and end time, inclusive), during which schedules are not allowed.
API Design
Using the above example:
Possible Extensions