Skip to main content
A Deployment defines what you want to deploy and how it gets deployed. It represents a service or application along with its job agent configuration — connecting the what (your service and its versions) with the how (the agent and workflow that executes the deployment).
In Ctrlplane’s mental model: Deployments = what & how, Environments = where, Policies = when.

What is a Deployment?

A deployment is a logical unit of software that you want to orchestrate:
  • API Service - Your backend API
  • Frontend Application - Web or mobile frontend
  • Background Worker - Async job processor
  • Database Migration - Schema changes
  • Configuration Update - Infrastructure configuration
Each deployment can have multiple versions (builds, releases) that get deployed to different environments and resources.

Deployment Properties

name

Human-readable display name for the deployment. Examples: “API Service”, “Frontend Application”, “Payment Processor”

slug

URL-friendly identifier, unique within the workspace. In the Terraform provider, the slug is auto-generated from the name field. Examples: api-service, frontend-app, payment-processor

resourceSelector

A CEL expression that limits which resources this deployment can target. If specified, only resources matching this expression will have release targets created. Examples:
If not specified, the deployment can target any resource in its environments.

jobAgents

An array of job agent configurations that execute deployment jobs. Each entry specifies which agent to use and how to configure it, with optional routing via selectors. When multiple job agents are configured, the selector field determines which agent handles which resources. This enables patterns like using ArgoCD for some clusters and GitHub Actions for others within the same deployment.

metadata

Optional key-value pairs for classification and policy matching:
Metadata can be referenced in policy selectors (e.g., deployment.metadata['tier'] == 'critical').

Creating a Deployment

Via Terraform

Deployments must be linked to a system using ctrlplane_deployment_system_link. This is a separate resource that associates a deployment with a system.

Via REST API

The API returns 202 Accepted with the deployment id. Reads are available immediately via GET /v1/workspaces/{workspaceId}/deployments/{deploymentId}.

Via CLI (YAML)

Multiple Deployments

Job Agent Configuration

Each job_agent block (Terraform) or entry in the jobAgents array (API) configures how a specific agent executes deployments. The Terraform provider supports typed provider blocks for each agent type.

GitHub Actions

ArgoCD

Terraform Cloud

Agent Routing with Selectors

When a deployment uses multiple job agents, use selector to route to specific resources:

Deployment Versions

Versions represent specific builds or releases of your deployment. They are typically created by your CI system after building.

Version Properties

Creating Versions (from CI)

After your CI builds an artifact, create a version in Ctrlplane:
Or via the REST API:

Version Status

Versions have a status field:
  • building - Version is being built (won’t be deployed yet)
  • ready - Version is ready for deployment (default for policies)
  • failed - Build failed (won’t be deployed)
Workflow:
  1. CI starts building → Create version with status building
  2. Build succeeds → Update status to ready
  3. Ctrlplane creates releases/jobs for ready versions
Or simpler:
  1. Build completes → Create version with status ready immediately

Version Config vs Job Agent Config

config: General version configuration, visible in UI
jobAgentConfig: Specific configuration for job execution (merged with the deployment’s job agent config at runtime)

Deployment Variables

Variables allow environment-specific or resource-specific configuration that gets resolved at job creation time and passed to the job agent.

Via Terraform

The Terraform provider has dedicated resources for deployment variables and their values:

Reference Values

Variable values can reference data from the workspace or resource metadata instead of using literal values:

Via REST API

Create a variable:
Set an environment-specific value:

Using Variables in Jobs

Variables are resolved during job creation and passed to the job agent:

Release Targets

When you create a deployment, Ctrlplane automatically creates release targets by crossing the deployment with environments and resources. Formula: Deployment × Environment × Resource = Release Targets Example: Given:
  • Deployment: “API Service”
  • Environments: Development, Staging, Production
  • Resources in Production: 3 clusters
Release Targets Created:
  1. API Service → Development → dev-cluster
  2. API Service → Staging → staging-cluster
  3. API Service → Production → prod-cluster-1
  4. API Service → Production → prod-cluster-2
  5. API Service → Production → prod-cluster-3
Each release target can receive deployment versions independently.

Filtering Release Targets

Use the deployment’s resourceSelector to limit which targets are created:
Only resources matching this CEL expression will have release targets for this deployment.

Deployment Lifecycle

1. Create Deployment

Define the deployment in Ctrlplane with job agent configuration.

2. CI Builds and Creates Version

Your CI pipeline builds the artifact and creates a deployment version.

3. Ctrlplane Evaluates Policies

Ctrlplane checks policies (approvals, environment progression, etc.).

4. Jobs Created

For each release target that should receive the version, a job is created.

5. Job Agent Executes

The configured job agent picks up the job and executes the deployment.

6. Status Updated

The job reports status back to Ctrlplane.

REST API Reference

Deployment CRUD

Create:
Get:
Update:
Delete:
List:

Versions

Create version:
List versions:
Update version:

Variables

Upsert variable:
Upsert variable value:

Terraform Provider Reference

Viewing Deployment Status

Via Web UI

  1. Navigate to the deployment
  2. See tabs:
    • Versions: All versions created
    • Releases: Active releases across targets
    • Jobs: Execution history
    • Variables: Configured variables

Via API

Get deployment details:
List versions:

Common Patterns

Microservices

Database + Application

Use a Deployment Dependency policy to ensure migrations complete before the API deploys.

Multi-Platform

Best Practices

Naming

Good Names:
  • ✅ “API Service”
  • ✅ “Frontend Application”
  • ✅ “Payment Processor”
Good Slugs:
  • api-service
  • frontend-app
  • payment-processor
Avoid:
  • ❌ “Service” (too generic)
  • ❌ “api_service” (use hyphens)
  • ❌ “API-SERVICE” (use lowercase)

Job Agent Configuration

Do:
  • ✅ Use version’s jobAgentConfig for version-specific values (like image tags)
  • ✅ Use deployment’s job agent config for stable configuration
  • ✅ Keep sensitive data in secrets (not in config)
  • ✅ Use agent selector when routing to different resource types

Version Tags

Good Tags:
  • v1.2.3 (semantic version)
  • 2024-01-15-prod (date-based)
  • abc123def (git commit)
Avoid:
  • latest (not specific)
  • prod (not a version)
  • test (too vague)

Resource Selectors

Use CEL resource selectors to:
  • Limit Kubernetes deployments to Kubernetes resources
  • Filter by resource status (e.g., resource.metadata['status'] == 'running')
  • Separate platform-specific deployments
  • Control which resources can receive a deployment

Troubleshooting

No release targets created

  • Check resourceSelector CEL expression matches some resources
  • Verify environments have matching resources
  • Ensure deployment is linked to a system (via ctrlplane_deployment_system_link in Terraform)

Jobs not being created for new versions

  • Check version status is ready
  • Review policies for denials/pending approvals
  • Verify job agent is configured
  • Check release target exists

Job agent config not working

  • Verify job agent block matches the agent type (e.g., github {} for GitHub Actions agents)
  • Check version’s jobAgentConfig overrides correctly
  • Review job agent logs for configuration errors

Next Steps