Executions
Track, monitor, and debug your job runs.
Understanding Executions
Every time a job runs, it creates an execution. For one-time jobs, there's typically one execution. For CronJobs, each scheduled run creates a new execution.
Execution States
| State | Description | Actions Available |
|---|---|---|
| Pending | Execution is being scheduled | Cancel |
| Running | Execution is in progress | View logs, Cancel |
| Succeeded | Execution completed successfully | View logs, View metrics |
| Failed | Execution failed after all retries | View logs, Retry |
Viewing Executions
From the Jobs List
The Jobs list shows summary information:
| Column | Description |
|---|---|
| Name | Job name |
| Type | Job or CronJob |
| Status | Current state |
| Schedule | Cron expression (CronJobs only) |
| Last Run | Time of last execution |
| Next Run | Scheduled time for next execution |
| Completions | Succeeded / Failed count |
| Active Jobs | Currently running executions |
Executions Tab
Navigate to your job and click Executions to see:
- Complete execution history
- Status of each run
- Start and end times
- Duration
- Success/failure status
Execution Details
Click on an execution to view:
Overview
- Status: Current execution state
- Started: When execution began
- Completed: When execution finished (if applicable)
- Duration: Total runtime
- Retries: Number of retry attempts
- Diagnostic: When available, a card showing the root cause of the failure, actionable suggestions, and sanitized technical details
Logs
View real-time and historical logs:
- stdout: Standard output from your job
- stderr: Error output
- Timestamps: When each line was logged
- Filtering: Search through logs
Include clear progress indicators in your job output to help with debugging.
Events
Track execution lifecycle events:
| Event | Description |
|---|---|
| Scheduled Execution Created | CronJob created this execution |
| Job Execution Started | Execution has begun |
| Instance Scheduled | Pod assigned to a node |
| Downloading Image | Pulling container image |
| Image Downloaded | Image pull complete |
| Instance Created | Pod created |
| Started | Container started running |
| Completed Successfully | Job finished without errors |
| Execution Finished | Execution completed |
Metrics
View resource usage during execution:
- CPU Usage: Actual CPU consumption over time
- Memory Usage: Memory consumption over time
- Duration: Execution timeline
Managing Executions
Run a CronJob Now
Trigger an immediate execution outside the schedule:
- Go to your CronJob
- Click Run Now
- A new execution starts immediately
This doesn't affect the regular schedule.
Cancel an Execution
Stop a running execution:
- Find the running execution
- Click Cancel or Stop
- Execution is terminated
Cancelled executions may leave work incomplete. Design jobs to handle interruption gracefully.
Retry a Failed Execution
For failed jobs:
- View the failed execution
- Check logs to understand the failure
- Click Retry to run again
Or create a new one-time job with the same configuration.
Completions Tracking
For jobs with multiple completions:
| Field | Description |
|---|---|
| Succeeded | Number of successful pod completions |
| Failed | Number of failed pod completions |
| Total | Total completions required |
Example: A job with completions=10, parallelism=3:
- Shows "7 / 10" when 7 pods succeeded
- Shows "10 / 10" when complete
Execution History
Retention
CronJobs retain a limited history:
| Setting | Default | Purpose |
|---|---|---|
| Successful Jobs History | 3 | Recent successful runs |
| Failed Jobs History | 1 | Recent failures for debugging |
Older executions are automatically deleted.
Viewing Historical Data
Even after execution cleanup, you can still access:
- Logs: Retained in the logging system
- Metrics: Retained in the metrics system
Troubleshooting Executions
When an execution fails, check the diagnostic card on the execution detail page first — it identifies the root cause and suggests fixes. If no diagnostic is available, use the approaches below.
Execution Stuck in Pending
Causes:
- Insufficient cluster resources
- Node scheduling constraints
- Image pull issues
Solutions:
- Check Events for scheduling errors
- Verify image exists and is accessible
- Check resource requests aren't too high
Execution Failed Immediately
Causes:
- Invalid command
- Missing environment variables
- Permission errors
Solutions:
- Check Logs for error messages
- Verify command syntax
- Ensure all required variables are set
- Check security context configuration
Execution Runs Forever
Causes:
- Job stuck in infinite loop
- Waiting for unavailable resource
- No proper exit condition
Solutions:
- Add timeout with
activeDeadlineSeconds - Check logs for stuck state
- Cancel and fix the job logic
Execution Keeps Failing
Causes:
- Persistent error condition
- Resource exhaustion
- External dependency failure
Solutions:
- Review logs across multiple attempts
- Check if error is transient or permanent
- Lower backoff limit to fail faster
- Fix underlying issue before retry
Parallel Execution Tracking
For jobs with parallelism > 1:
Indexed Jobs
Each pod receives a unique index:
- Environment variable:
JOB_COMPLETION_INDEX - Values: 0 to (completions - 1)
Example with completions=5, parallelism=2:
- First batch: Pods with index 0, 1
- Second batch: Pods with index 2, 3
- Third batch: Pod with index 4
Non-Indexed Jobs
All pods perform the same work. Use external coordination if needed.
Best Practices
Monitoring
- Set up alerts for failed executions
- Review logs regularly even for successful jobs
- Track duration trends to catch performance degradation
Reliability
- Design for failure: Assume executions can fail
- Idempotent operations: Safe to run multiple times
- Clear success criteria: Know what "done" means
Performance
- Right-size parallelism: Match to work characteristics
- Avoid over-scheduling: Don't run more often than needed
- Monitor resource usage: Optimize based on actual consumption