Kubernetes CronJob guide
Understand Kubernetes CronJob schedules, YAML, concurrencyPolicy, missed jobs, and timezone behavior.
Kubernetes CronJobs use standard five-field cron syntax in .spec.schedule.
Example
apiVersion: batch/v1
kind: CronJob
metadata:
name: daily-cleanup
spec:
schedule: "0 0 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
Operational behavior
concurrencyPolicycontrols overlapping jobs.startingDeadlineSecondscontrols how late missed jobs may start.restartPolicybelongs to the Pod template.- Timezone behavior depends on cluster support and
.spec.timeZone.