Appearance
CronJobs
Use a Kubernetes CronJob to repeat a task on a schedule, such as refreshing data every night, running evaluations, or cleaning up old files. Each run creates a job whose status and logs you can inspect.
Create a cronjob
- Open Kubernetes / CronJobs.
- Select a namespace and open the create form.
- Enter a name, select a plan, and choose a container image.
- Enter the schedule using Kubernetes cron syntax.
- Optionally enter a shell command, then create the cronjob.
Use kubectl for settings the form does not include. These let you control overlapping runs, retained job history, pauses, and late starts, or add labels, annotations, environment variables, storage, and other job settings.
Operating cronjobs on RemoteGPU
- Use
concurrencyPolicyto choose whether runs of this cronjob can overlap. WithForbid, Kubernetes skips a scheduled start if the previous job is still running. A missed run may start later, depending on its deadline. See Kubernetes concurrency policy. - Set the success and failure history limits to choose how many finished jobs to keep for inspection.
- Open Kubernetes / CronJobs to check each run's status, pods, events, and logs.
Troubleshooting
| Symptom | What to check |
|---|---|
| CronJob does not create jobs | Confirm the schedule is valid Kubernetes cron syntax and the cronjob is not suspended |
| Scheduled jobs fail | Inspect the created job, pod events, and container logs; the job template follows the same rules as a normal Job |
| Runs overlap unexpectedly | Set concurrencyPolicy to Forbid to prevent runs of the same cronjob from overlapping |
| Completed jobs accumulate | Set successfulJobsHistoryLimit and failedJobsHistoryLimit in the cronjob manifest |
| Console-created cronjob needs advanced fields | Use kubectl for fields that are not exposed in the console form |
Read next
- Read Jobs for one-off batch work.
- Read Deployments for long-running services.
- Read Kubernetes overview to set up access from the console or your terminal.