Configure a CronJob
Schedule batch tasks to run automatically at specified times using Cron expressions. Ideal for recurring reports, cleanup jobs, and periodic processing.
Prerequisites
- Target Namespace exists.
- Understand Cron expression format (e.g.
0 2 * * *= every day at 2:00 AM).
Step 1. Open the Create form
- In the left menu, select Workloads → CronJobs.
- Click Create CronJob in the top-right corner.
- Select Create as form from the dropdown.
Step 2. Configure the CronJob
| Field | Description | Example |
|---|---|---|
| Name | CronJob name | daily-report |
| Namespace | Target Namespace | default |
| Schedule | Cron expression (UTC) | 0 2 * * * |
| Concurrency Policy | Behavior when a previous Job is still running | Forbid |
| Successful Job History | Number of successful Jobs to keep | 3 |
| Failed Job History | Number of failed Jobs to keep | 1 |
Cron expression reference
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6, Sun=0)
│ │ │ │ │
* * * * *| Expression | Meaning |
|---|---|
0 2 * * * | Every day at 2:00 AM (UTC) |
0 9 * * 1-5 | Mon–Fri at 9:00 AM |
*/30 * * * * | Every 30 minutes |
0 0 1 * * | First day of each month at midnight |
Step 3. Configure the Container
| Field | Description | Example |
|---|---|---|
| Image | Container image to run | python:3.11 |
| Command | Container entrypoint | python |
| Args | Execution arguments | -c, "print('report done')" |
Step 4. Create and verify
Click Create.
In the CronJobs list, the Active column updates according to the schedule.
| Column | Description |
|---|---|
| Active | Number of currently running Jobs |
| Last schedule time | Time the most recent Job was started |
INFO
After creation, the CronJob waits until the next scheduled time. To test immediately, you can trigger a Job manually by editing the CronJob YAML and setting startingDeadlineSeconds: 0.