Sample Header Ad - 728x90

multiple schedules for a single task in a k8s cronjob

0 votes
2 answers
3178 views
**Warning**: k8s greenhorn on this side. I need to run a task that will be set up in a k8s cronjob. I need it to run every 45 minutes. Having this in the schedule does not work: 0/45 * * * * Because it would run at X:00, then X:45 then X+1:00 instead of X+1:30. So I might need to set up multiple schedule rules instead: 0,45 0/3 * * * 30 1/3 * * * 15 2/3 * * * I am wondering if it's possible to set up multiple schedules in a _single_ CronJob definition or if I will have to setup multiple CronJobs so that each CronJob takes care of each line. https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/cron-job-v1/ **Update**: I just read that it's possible to have more than a single manifest written in a single yaml file so it might work with 3 manifests.... but knowing if it's possible with a single manifest would be awesome.
Asked by eftshift0 (707 rep)
Oct 28, 2021, 03:12 PM
Last activity: Jul 21, 2025, 06:07 PM