Skip to main content
This guide explains how Ctrlplane turns deployment versions into actual deployments through releases and jobs.

Overview

The flow from version to execution:

Release

A Release represents the intent to deploy a specific version to a specific release target (Deployment × Environment × Resource). Ctrlplane creates one release per target. A target is a single resource that matches the deployment’s resource selector and is also included in an environment (via the environment’s selector). When a release is approved, Ctrlplane creates a job for that same target.

Release Properties

Releases do not carry their own status field. Instead, the state of a release is determined by the Release Target State, which tracks:
  • Desired release — the release that policies have selected for deployment
  • Current release — the release whose job completed successfully (with passing verifications)
  • Latest job — the most recent job created for this target, along with its status and verifications

How Releases are Created

Releases are created automatically by Ctrlplane when:
  1. A new deployment version is created with status ready
  2. Ctrlplane evaluates which release targets should receive this version
  3. For each target, a release is created
  4. Policies are evaluated to determine if the release can proceed
Example Flow:

Release Lifecycle

Viewing Releases

Via Web UI:
  1. Navigate to deployment
  2. Click “Releases” tab
  3. See all releases with their current and desired state
Via CLI:

Release Variables

Releases have resolved variables from:
  • Deployment variables (with environment-specific values)
  • Resource variables
  • Version config
These are passed to the job for execution.

Cancelling Releases

Cancel a pending or active release:
Active releases will have their jobs cancelled.

Job

A Job is the actual deployment task that gets executed by a job agent. Jobs are created from approved releases.

Job Properties

Job Status

  • pending - Job created, waiting for agent to pick up
  • triggered - Job dispatched to external system (e.g., GitHub Actions)
  • in_progress - Job is currently executing
  • completed - Job finished successfully
  • failed - Job failed
  • cancelled - Job was cancelled
  • skipped - Job was skipped
  • invalid_job_agent - Job agent configuration invalid

Job Lifecycle

Job Configuration

Jobs receive configuration from multiple sources (in priority order):
  1. Version’s jobAgentConfig (highest priority)
  2. Deployment’s jobAgentConfig
  3. Resolved variables
  4. Release context (environment, resource info)
Example merged config:

Job Agents

Job agents are responsible for:
  1. Polling for new jobs (GET /job-agents/{agentId}/queue/next)
  2. Acknowledging jobs
  3. Executing the deployment
  4. Reporting status updates
  5. Marking job as completed or failed
Built-in Agent Types:
  • GitHub Actions - Triggers GitHub workflow
  • Kubernetes - Creates Kubernetes Job
  • ArgoCD - Syncs ArgoCD Application

Job Execution Flow

1. Job Agent Polls

Response:

2. Agent Acknowledges Job

3. Agent Executes Deployment

The agent uses the job configuration to perform the deployment: Kubernetes Agent Example:
GitHub Actions Example:

4. Agent Updates Status

As the deployment progresses:

External Job IDs

When job agents trigger external systems (like GitHub Actions), they can store the external job ID:
This allows linking to the external system’s UI for detailed logs.

Job Retry

If a job fails, you can create a new job for the same release:
This creates a new job for the release.

Viewing Jobs

Via Web UI:
  1. Navigate to deployment
  2. Click “Jobs” tab
  3. See execution history with status
Via CLI:

Version → Release → Job Example

Let’s walk through a complete example:

1. CI Creates Version

2. Ctrlplane Creates Releases

Ctrlplane finds release targets:
  • API Service → Production → cluster-1
  • API Service → Production → cluster-2
Creates 2 releases. Production releases are blocked by the approval policy.

3. User Approves

Both releases are now eligible for job creation.

4. Ctrlplane Creates Jobs

Two jobs created:
  • job_1 for cluster-1
  • job_2 for cluster-2
Both jobs start with status: pending

5. Job Agent Polls

Receives both jobs.

6. Agent Processes Jobs

For each job:

7. Jobs Complete

Both jobs complete successfully. The release target state updates: the release becomes the current release for each target.

Release Sequencing

By default, when a new version is created for a deployment:
  • Existing jobs for older versions may be cancelled
  • New jobs are created for the new version
This behavior is controlled by policies and can be configured.

Sequential Releases

Ensure releases happen one at a time:

Parallel Releases

Allow multiple versions to deploy concurrently:

Deployment Tracing

For detailed observability, use the trace API to report execution steps:
Traces are linked to jobs and provide fine-grained visibility into deployment execution.

Best Practices

Job Status Updates

Do:
  • ✅ Acknowledge jobs immediately when picked up
  • ✅ Update status regularly during execution
  • ✅ Provide descriptive messages
  • ✅ Mark as completed or failed explicitly
Don’t:
  • ❌ Leave jobs in pending state indefinitely
  • ❌ Skip acknowledging jobs
  • ❌ Provide generic error messages

Error Handling

When jobs fail:
  1. Set status to failed
  2. Include detailed error message
  3. Store external job ID for log access
  4. Consider automatic retry logic in agent

Release Management

  • Monitor pending releases (awaiting approval)
  • Set up notifications for failed jobs
  • Regularly review release history
  • Clean up old completed releases (retention policy)

Troubleshooting

Releases not progressing

  • Check if policies require approval
  • Review policy evaluation results
  • Verify environment progression requirements met
  • Check for blocking policy rules

Jobs not being picked up by agent

  • Verify agent is running and polling
  • Check agent ID matches deployment configuration
  • Review job agent logs for errors
  • Confirm agent has network access to API

Jobs fail immediately

  • Review job agent configuration
  • Check external system (GitHub, Kubernetes) availability
  • Verify credentials/permissions
  • Review job logs and error messages

Multiple jobs created for same release

  • Check release sequencing configuration
  • Review job creation logic
  • May be intentional for retry scenarios

Next Steps