Kubernetes
Jobs Commands
Run one-off tasks and scheduled workloads. Learn to create Jobs for batch processing and CronJobs for scheduled tasks with proper retry and completion handling.
6 commands
Pro Tips
Set 'backoffLimit' on Jobs to control retry attempts. Set 'activeDeadlineSeconds' for timeout.
Use 'successfulJobsHistoryLimit' and 'failedJobsHistoryLimit' on CronJobs to manage old job retention.
Test CronJobs by creating a Job from them: 'kubectl create job test --from=cronjob/mycronjob'
Common Mistakes
CronJobs may create multiple Jobs if a previous run hasn't completed. Set 'concurrencyPolicy: Forbid' to prevent this.
Jobs don't clean up their pods by default. Set 'ttlSecondsAfterFinished' for automatic cleanup.