Skip to main content

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:

SettingDescription
Backoff LimitMaximum retry attempts before marking as failed (0-100)
Restart PolicyOnFailure (retry) or Never (fail immediately)

Parallel Execution​

Run multiple job instances simultaneously:

SettingDescription
CompletionsTotal successful runs required
ParallelismMaximum 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:

PolicyBehavior
AllowRun new job alongside existing one
ForbidSkip the scheduled run if previous is still running
ReplaceStop the running job and start a new one

Job States​

StateDescription
PendingJob is being scheduled
RunningJob is executing
SucceededJob completed successfully
FailedJob failed after all retries
SuspendedCronJob is paused (won't create new instances)
ActiveCronJob has running job instances

Compute Classes​

Jobs use the same compute classes as containers, optimized for batch workloads:

ClassCPU:RAM RatioBest For
Eco1:2Simple scripts, lightweight processing
Standard1:4General batch workloads
Production1:4Critical data processing
Prod. Compute1:2CPU-intensive calculations
Prod. Memory1:8Data-heavy operations, ML tasks
ARM1:4Cost-optimized batch processing
Choosing Resources

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:

SettingDefaultDescription
Successful Jobs History3Number of successful executions to retain
Failed Jobs History1Number 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:

EventDescription
Job Execution StartedJob execution has begun
StartedContainer is running
Completed SuccessfullyJob finished without errors
Execution FinishedJob execution completed
Image DownloadedContainer image pulled
Instance CreatedPod created for execution
Instance ScheduledPod scheduled on node
Scaling in ProgressJob 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​

  1. Navigate to Jobs
  2. Click Create Job
  3. Choose job type (Job or CronJob)
  4. Configure the job
  5. Click Create

Detailed guide →

Run a CronJob Manually​

  1. Go to your CronJob details
  2. Click Run Now
  3. A new execution starts immediately

Suspend a CronJob​

  1. Go to your CronJob details
  2. Click Suspend
  3. No new executions will be scheduled

Resume a CronJob​

  1. Go to your suspended CronJob
  2. Click Resume
  3. 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 activeDeadlineSeconds for overall job timeout
  • Use ttlSecondsAfterFinished to 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