Skip to main content
Deployment dependency rules ensure that one deployment succeeds before another can proceed. Use them to coordinate related services, enforce deployment order across microservices, or manage infrastructure dependencies.

Overview

Why Use Deployment Dependencies?

Deployment dependency rules help you:
  • Coordinate services - Deploy database before API, API before frontend
  • Manage infrastructure - Infrastructure changes before application updates
  • Enforce order - Shared libraries before dependent services
  • Reduce failures - Prevent cascading failures from out-of-order deploys

Configuration

Properties

deploymentDependency.dependsOn
string
required
CEL expression to match upstream release targets that must exist before this deployment can proceed. The expression can reference both deployment and version properties of the currently deployed upstream release.

Available CEL Variables

The dependsOn expression is evaluated against each release target on the same resource that has a successful release. Both deployment.* and version.* fields are available:

How It Works

  1. Release created - A new version is released for a deployment with dependency rules.
  2. Same-resource resolution - Ctrlplane finds all release targets on the same resource as the current target.
  3. Version resolution - For each release target, Ctrlplane resolves the deployment and its currently deployed version (from the latest successful job).
  4. CEL evaluation - The dependsOn expression is evaluated against each {deployment, version} pair.
  5. Deployment allowed - If at least one upstream release target matches the selector, the deployment can proceed.

Common Patterns

Database Before API

Ensure database migrations complete before API deploys:

Service Dependency Chain

Create a chain of dependencies:

Shared Library Dependencies

Ensure shared libraries are deployed before dependent services:

Version-Scoped Dependencies

Require a specific version range of an upstream deployment:

Version Metadata Filtering

Depend on an upstream deployment running a version with specific metadata:

Infrastructure First

Deploy infrastructure changes before application updates:

Multi-Service Dependency

Depend on multiple services using CEL in operator:

Combining with Other Rules

With Environment Progression

With Gradual Rollout

Best Practices

Dependency Design

Recommendations

  • ✅ Keep dependency chains short (2-3 levels max)
  • ✅ Use metadata to group related deployments
  • ✅ Document why dependencies exist
  • ✅ Test dependency resolution in staging
  • ✅ Monitor for circular dependency issues

Anti-Patterns

  • ❌ Deep dependency chains (> 3 levels)
  • ❌ Circular dependencies (A → B → A)
  • ❌ Over-coupling unrelated services
  • ❌ Using dependencies when environment progression would suffice

Troubleshooting

Deployment Blocked

If a deployment is blocked waiting for dependencies:
  1. Check the dependency deployment’s status
  2. Verify the CEL expression matches the expected deployment
  3. Remember that dependencies are resolved per-resource — the upstream deployment must have a successful release on the same resource
  4. Review the dependency deployment’s success status

Circular Dependencies

If you encounter circular dependency errors:
  1. Review the dependency graph
  2. Break the cycle by removing one dependency
  3. Consider using environment progression instead

Next Steps