Skip to main content
The ArgoCD job agent creates and syncs ArgoCD Applications, enabling GitOps-style deployments with automatic health verification.

How It Works

  1. Ctrlplane renders an ArgoCD Application from your template
  2. The Application is created or updated via ArgoCD API
  3. ArgoCD syncs the application to Kubernetes
  4. Ctrlplane verifies the application reaches Healthy + Synced status
  5. Job is marked successful when verification passes

Prerequisites

  • ArgoCD server with API access
  • API token with application create/update permissions
  • Network connectivity from Ctrlplane to ArgoCD

Configuration

Job Agent Setup

Create a job agent with type argo-cd:

Deployment Configuration

Template Context

The template has access to all job context. Variables are accessed using Go template syntax: {{.variable.property}}. The job context is derived from the resources returned by the deployment selector (and narrowed by the environment selector), so the data available to the template reflects that specific target.

Top-Level Variables

Resource Properties

Each job invocation is tied to a specific resource instance returned by your selector, so the .resource values can differ for every ArgoCD template invocation.

Deployment Properties

Each job invocation is tied to a specific deployment, so .deployment values can differ for every ArgoCD template invocation.

Environment Properties

Each job invocation is tied to a specific environment, so .environment values can differ for every ArgoCD template invocation.

Version Properties

Access via .version:

Job Properties

Variables

The .variables map contains all resolved deployment variables as strings:

Accessing Nested Config

Resource and version configs are arbitrary objects. Access nested properties:

Template Functions

The template supports Sprig functions:

Automatic Verification

When an ArgoCD Application is created, Ctrlplane automatically starts a verification that checks:
  • Application sync status is Synced
  • Application health status is Healthy or Progressing
The verification polls the ArgoCD API every 10 seconds for 5 iterations.

Example: Multi-Environment Setup

Example: Kustomize Overlay

Troubleshooting

Application not syncing

  • Check ArgoCD server logs
  • Verify the repository is accessible from ArgoCD
  • Check the target revision exists

Authentication errors

  • Verify the API token is valid
  • Check token has correct permissions
  • Ensure serverUrl includes the correct port

Verification failing

  • Check ArgoCD Application status in the UI
  • Review sync errors in ArgoCD
  • Verify destination cluster is accessible