Jobs Overview
Execute batch tasks, scheduled operations, and one-time workloads.
Jobs are ideal for running scripts, data processing, backups, migrations, and other tasks that don't need to run continuously. SailOps supports both one-time jobs and scheduled CronJobs.
What is a Job?
A Job in SailOps runs a containerized task to completion. Unlike containers that run continuously, jobs:
- Execute a specific command or script
- Complete after the task finishes
- Track success and failure counts
- Support retry on failure
Job Types
One-Time Job
A standard job that runs once when created:
- Executes immediately upon creation
- Runs until completion or failure
- Ideal for migrations, data imports, one-off scripts
CronJob (Scheduled Job)
A job that runs on a schedule:
- Uses cron expressions for scheduling
- Automatically creates job instances at scheduled times
- Tracks execution history
- Supports timezone configuration
Key Features
Job Groups
You can assign an optional group to a job or CronJob at creation. Jobs that share the same group are folded into a single collapsible row in the jobs list, making it easy to manage large sets of related jobs (e.g. daily imports, batch pipelines).
- Free text, up to 63 characters.
- Fixed at creation — cannot be changed later.
- No uniqueness constraint: multiple jobs can share the same group.
- A group with only one member is displayed as a regular row.
Flexible Scheduling
Configure precise execution timing with cron expressions:
- Every minute:
* * * * * - Every 5 minutes:
*/5 * * * * - Every hour:
0 * * * * - Daily at midnight:
0 0 * * * - Weekdays at 9 AM:
0 9 * * 1-5
Retry Management
Control how jobs handle failures:
| Setting | Description |
|---|---|
| Backoff Limit | Maximum retry attempts before marking as failed (0-100) |
| Restart Policy | OnFailure (retry) or Never (fail immediately) |
Parallel Execution
Run multiple job instances simultaneously:
| Setting | Description |
|---|---|
| Completions | Total successful runs required |
| Parallelism | Maximum concurrent instances |
Example: Process 10 items with 3 parallel workers:
- Completions: 10
- Parallelism: 3
Concurrency Policies (CronJobs)
Control what happens when a scheduled job triggers while a previous run is still active:
| Policy | Behavior |
|---|---|
| Allow | Run new job alongside existing one |
| Forbid | Skip the scheduled run if previous is still running |
| Replace | Stop the running job and start a new one |
Job States
| State | Description |
|---|---|
| Pending | Job is being scheduled |
| Running | Job is executing |
| Succeeded | Job completed successfully |
| Failed | Job failed after all retries |
| Suspended | CronJob is paused (won't create new instances) |
| Active | CronJob has running job instances |
Compute Classes
Jobs use the same compute classes as containers, optimized for batch workloads:
| Class | CPU:RAM Ratio | Best For |
|---|---|---|
| Eco | 1:2 | Simple scripts, lightweight processing |
| Standard | 1:4 | General batch workloads |
| Production | 1:4 | Critical data processing |
| Prod. Compute | 1:2 | CPU-intensive calculations |
| Prod. Memory | 1:8 | Data-heavy operations, ML tasks |
| ARM | 1:4 | Cost-optimized batch processing |
Start with Eco class at minimum resources for testing. Increase based on actual job performance and duration.
Execution History
CronJobs maintain a history of executions:
| Setting | Default | Description |
|---|---|---|
| Successful Jobs History | 3 | Number of successful executions to retain |
| Failed Jobs History | 1 | Number of failed executions to retain |
View execution details including:
- Start and completion times
- Success/failure status
- Logs from each execution
- Resource usage metrics
Job Events
Monitor job lifecycle through events:
| Event | Description |
|---|---|
| Job Execution Started | Job execution has begun |
| Started | Container is running |
| Completed Successfully | Job finished without errors |
| Execution Finished | Job execution completed |
| Image Downloaded | Container image pulled |
| Instance Created | Pod created for execution |
| Instance Scheduled | Pod scheduled on node |
| Scaling in Progress | Job replicas being adjusted |
Startup diagnostics
When a job or CronJob execution fails, the Overview tab displays a diagnostic card. For CronJobs, diagnostics also appear on the Executions tab next to each execution.
The diagnostic card includes:
- A summary of the failure (e.g. "The execution failed", "Memory limit exceeded")
- Suggestions — actionable steps to resolve the issue
- Technical details — sanitized runtime evidence (credentials and sensitive data are automatically redacted)
- Context: execution name, instance name, exit code, and user ID when relevant
When a job is retrying after a failure, the diagnostic shows the previous failure alongside the retry status. After the job recovers, the last diagnostic remains visible as a Previous failure with its resolution timestamp.
Diagnostics require no configuration and refresh automatically.
Service Connections
Jobs and CronJobs can connect to managed services (PostgreSQL, MariaDB, Valkey, NATS) the same way containers do. Open the Connections tab on a job to view, add, or remove connections.
- CronJobs: full connection management — add, edit, and delete connections at any time. New connections take effect on the next scheduled execution.
- One-time Jobs: connections are read-only after creation because a Job's pod template is immutable once submitted to Kubernetes.
For connection details such as aliases, access levels, and injected variables, see Service Connections.
Quick Actions
Create a Job
- Navigate to Jobs
- Click Create Job
- Choose job type (Job or CronJob)
- Configure the job
- Click Create
Run a CronJob Manually
- Go to your CronJob details
- Click Run Now
- A new execution starts immediately
Suspend a CronJob
- Go to your CronJob details
- Click Suspend
- No new executions will be scheduled
Resume a CronJob
- Go to your suspended CronJob
- Click Resume
- Scheduling resumes from next interval
Best Practices
Idempotent Jobs
Design jobs to be safely re-runnable:
- Use transactions for database operations
- Check for existing results before processing
- Handle duplicate execution gracefully
Resource Estimation
Test jobs with smaller datasets first to estimate resource needs:
- Monitor memory usage during execution
- Track CPU utilization patterns
- Adjust limits based on actual consumption
Timeout Configuration
Set appropriate timeouts to prevent runaway jobs:
- Use
activeDeadlineSecondsfor overall job timeout - Use
ttlSecondsAfterFinishedto clean up jobs that succeeded. A job that failed is kept so you can still read its logs, and you delete it yourself once you are done. On a scheduled job the same setting is handled by Kubernetes and removes every execution, successful or failed.
Logging
Ensure comprehensive logging:
- Log progress for long-running jobs
- Include clear success/failure indicators
- Output structured logs for easier parsing
Related Topics
- Create a Job
- Job Configuration
- Executions
- Service Connections
- Containers (for long-running workloads)