AdvancedCronJob is an enhanced version of CronJob. The original CronJob creates Job periodically according to schedule rule, but AdvancedCronJob provides template supported multpile job resources.
# Option 1: use jobTemplate, which is equivalent to original CronJob
# Option 2: use broadcastJobTemplate, which will create a BroadcastJob object when cron schedule triggers
# Options 3(future): ...
- jobTemplate：create Jobs periodically, which is equivalent to original CronJob
- broadcastJobTemplate：create BroadcastJobs periodically, which support to dispatch Jobs on every node
schedule: "*/1 * * * *"
- name: pi
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
The YAML below defines an AdvancedCronJob. It will create a BroadcastJob every minute, which will run a job on every node.
All CronJob schedule: times are based on the timezone of the kruise-controller-manager by default, which means the timezone set for the kruise-controller-manager container determines the timezone that the cron job controller uses.
FEATURE STATE: Kruise v1.3.0
However, we have introduce a
spec.timeZone field in v1.3.0.
You can set it to the name of a valid time zone name. For example, setting
spec.timeZone: "Etc/UTC" instructs Kruise to interpret the schedule relative to Coordinated Universal Time.
A time zone database from the Go standard library is included in the binaries and used as a fallback in case an external database is not available on the system.