How It Works
- Ctrlplane renders an ArgoCD Application from your template
- The Application is created or updated via ArgoCD API
- ArgoCD syncs the application to Kubernetes
- Ctrlplane verifies the application reaches
Healthy+Syncedstatus - 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 typeargo-cd:
Deployment Configuration
| Field | Required | Description |
|---|---|---|
serverUrl | Yes | ArgoCD server URL (host:port) |
apiKey | Yes | ArgoCD API token |
template | Yes | Go template for ArgoCD Application |
Template Context
The template has access to all job context:| Variable | Description |
|---|---|
.job | Job details (id, status, etc.) |
.release | Release details |
.version | Version being deployed (.tag, .name, etc.) |
.deployment | Deployment details (.name, .slug) |
.environment | Environment details (.name, .id) |
.resource | Target resource (.name, .config, .metadata) |
.variables | Merged deployment variables |
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
HealthyorProgressing
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
serverUrlincludes the correct port
Verification failing
- Check ArgoCD Application status in the UI
- Review sync errors in ArgoCD
- Verify destination cluster is accessible