Skip to content

4.4. Jobs

Overview

The Jobs page manages every Job held on the MCM control plane in one place. A Job is the workload that creates one or more pods and runs them until the work given to them completes successfully.

What it is for:

  • Managing multi-cluster Jobs together
  • Running and monitoring one-off batch work
  • Tracking whether a Job completed or failed
  • Checking the PropagationPolicy and OverridePolicy

Where Jobs are used:

  • Database migrations
  • Batch data processing
  • Backup and restore work
  • Running a one-off script
  • ETL (extract, transform, load) work

How the Screen Is Laid Out

The Jobs page shows the Job list as a table.

The Jobs main screen

The Elements at the Top of the Page

ElementDescription
Namespace filterShows only the Jobs of a particular namespace
Refresh buttonRefreshes the Job list
Create buttonOpens the dialog for creating a new Job
Search boxSearches by Job name

Table Columns

ColumnDescriptionSortable
NameThe Job name
NamespaceThe namespace the Job belongs to
StatusThe Job state and how far it has got (succeeded / total)
ImageThe container image name
AgeThe time since the Job was created
ActionsThe edit and delete buttons-

How Status Is Shown

The Status column shows the Job's current state and how far it has got:

StatusDescriptionHow it is shown
CompleteEvery pod completed successfullyA green badge with N/N
RunningPods are runningA blue badge with N/N
PendingPods are waiting to be scheduledA yellow badge with 0/N
FailedThe Job failedA red badge

For example Pending 0/1 -- 0 of 1 target completions done, waiting.

Job Detail

Clicking a Job row opens the detail panel.

Job detail

The Detail Panel Header

ElementDescription
Job nameThe name of the chosen Job
NamespaceThe namespace the Job belongs to
StatusPending / Running / Complete / Failed

The Action Buttons

ButtonWhat it does
RefreshRefreshes the Job information
EditOpens the YAML edit mode
DeleteDeletes the Job

The Tabs

The Overview Tab

Shows the Job's basic information, specification, and status.

Basic information:

ItemDescription
NameThe Job name
NamespaceThe namespace the Job belongs to
StatusPending / Running / Complete / Failed
AgeThe time since creation
CreatedWhen the Job was created

Job Specification:

ItemDescription
CompletionsThe number of pods that must complete successfully
ParallelismThe number of pods that may run at once
Backoff LimitThe retry limit on failure
Active Deadline (s)The time limit on the Job's run, in seconds

Pod state:

Shows the Job's pods visually:

  • Succeeded: pods that completed successfully
  • Running: pods running now
  • Pending: pods waiting to be scheduled
  • Failed: pods that failed

Job Status:

ItemDescription
SucceededThe number of pods that completed successfully
FailedThe number of pods that failed
ActiveThe number of pods running now
Start TimeWhen the Job started
Completion TimeWhen the Job completed

Container images:

Shows the container images defined on the Job.

The Multi-Cluster Policies Tab

Shows the multi-cluster policies that apply to the Job.

The multi-cluster policies tab

PropagationPolicy:

ColumnDescription
NameThe PropagationPolicy name
NamespaceThe namespace the policy belongs to
ScopeNamespace-scoped policies / cluster-scoped policies
Target ClustersThe list of target clusters

OverridePolicy:

Shown where there are per-cluster custom settings.

The Labels Tab

Shows the list of Kubernetes labels applied to the Job.

The Annotations Tab

Shows the list of annotations applied to the Job.

The Pods Tab

Shows the list of pods created by that Job.

The Pods tab
ColumnDescription
NameThe pod name (my-job2-f9wc5, for example)
ClusterThe cluster the pod is running on
StatusThe pod state (Running / Pending / Succeeded / Failed)
NodeThe node the pod is scheduled on
RestartsThe pod restart count
AgeThe time since the pod was created
ActionsThe view and delete buttons

The Events Tab

Shows the Kubernetes events related to the Job.

Creating a Job

Creates a new Job on the MCM control plane.

Fields

FieldRequiredDescription
NameThe Job name
NamespaceThe namespace to deploy into
Container imageThe container image URL
Command-The container command
Completions-The number of pods that must complete (default: 1)
Parallelism-The number of pods running at once (default: 1)
Backoff Limit-The retry limit (default: 6)
Active Deadline-The time limit on the run, in seconds

Editing the YAML

The "Edit YAML" tab lets you write the Job definition directly.

Job Operations

Editing a Job

  1. Choose the Job
  2. Press the "Edit" button in the detail panel
  3. Change the Job definition in the YAML editor
  4. Press the "Save" button

Note: the specification of a Job already running can be changed only in limited ways.

Deleting a Job

⚠️ Caution: deleting a Job deletes every pod that belongs to it.

  1. Choose the Job to delete
  2. Press the "Delete" button in the detail panel
  3. Type the Job name in the confirmation dialog
  4. Press the "Delete" button

Worked Examples

Scenario 1: Creating a Database Migration Job

  1. Press the "Create" button
  2. Enter the Job details:
    • Name: db-migration
    • Namespace: production
    • Container image: my-registry/db-migrate:v1.0
    • Command: ["./migrate.sh", "--apply"]
  3. Press the "Create" button
  4. Name the target clusters with a PropagationPolicy
  5. Monitor the Job to completion

Scenario 2: Checking Job Status

  1. Click the Job you want to check in the list
  2. Check the Job Status on the Overview tab:
    • The succeeded, failed, and active pod counts
    • The start and completion times
  3. Check individual pod state on the Pods tab
  4. Check the Job's events on the Events tab

Scenario 3: Parallel Batch Processing

  1. Press the "Create" button
  2. Enter the Job details:
    • Name: batch-process
    • Completions: 10 (10 pieces of work must complete)
    • Parallelism: 3 (3 pods run at once)
  3. Press the "Create" button
  4. Monitor progress on the Overview tab:
    • Active: 3 at most
    • Succeeded: climbing from 0 to 10

Scenario 4: Checking the Retries of a Failed Job

  1. Click the failed Job
  2. Check the Job Specification on the Overview tab:
    • Backoff Limit: the retry count
  3. Find the cause of failure on the Events tab
  4. Check the failed pod's logs on the Pods tab
  5. Delete, fix, and recreate the Job if needed

Scenario 5: Running a Job Across Clusters

  1. Create the Job and apply a PropagationPolicy
  2. Check the "Multi-Cluster Policies" tab in the detail panel
  3. Confirm the Job has been shared out to the target clusters
  4. Check how the pods are running per cluster on the Pods tab
  5. Monitor until the Job completes on each cluster

Job against CronJob

TraitJobCronJob
How it runsOnceOn a periodic schedule
TriggerRuns as soon as it is createdRuns on the cron schedule
Where it is usedMigrations, backupsPeriodic reports, regular backups
ManagementCreated and deleted by handCreates Jobs automatically

Completions and Parallelism

Completions:

  • The number of pods that must complete for the Job to count as successful
  • Default: 1

Parallelism:

  • The number of pods that may run at once
  • Default: 1
  • When parallelism is below completions, pods are created in sequence

The Backoff Limit

  • The retry limit when a pod fails
  • Default: 6
  • The Job is marked failed once the backoff limit is reached
  • The retry interval grows exponentially (10 seconds, 20 seconds, 40 seconds...)

The TTL Controller

The feature that cleans up completed Jobs automatically:

  • ttlSecondsAfterFinished: how long to wait after completion before deleting
  • For example ttlSecondsAfterFinished: 3600 -- deleted an hour after completion

The Active Deadline

  • activeDeadlineSeconds: the maximum time a Job may run
  • On timeout the Job and every pod are ended
  • Useful for preventing a long-running job

Next Steps