ArgoCD Deployment Tracking Collector
Runs on a central GitOps repo, correlates each ArgoCD Application to the service that builds its image, and pushes that service's deployment posture onto its own component out-of-band. Post-merge only (cannot gate PRs). Do not also run argocd-deployment-gate on the same service.
argocd-deployment-tracking to your lunar-config.yml:uses: github://earthly/lunar-lib/collectors/argocd-deployment-tracking@v1.0.5
What This Integration Collects
This integration includes 1 collector that gather metadata from your systems.
tracking
Correlates each ArgoCD Application back to the source-code component it
deploys (annotation -> image -> tag -> repoURL, first match wins), then
writes that application's deployment posture onto the source component's
Component JSON using the out-of-band collect syntax
(lunar collect --component
How Collectors Fit into Lunar
Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.
Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.
Learn How Lunar Works →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"cd": {
"gitops": {
"source": {
"tool": "argocd",
"integration": "external"
},
"linked_from": "github.com/org/gitops",
"applications": [
{
"name": "payment-api",
"path": "apps/payment-api.yaml",
"valid": true,
"kind": "Application",
"project": "platform",
"sync_policy": {
"automated": true,
"prune": true,
"self_heal": true
},
"destination": {
"server": "https://kubernetes.default.svc",
"namespace": "payments"
},
"source_ref": {
"repoURL": "https://github.com/org/gitops.git",
"path": "payment-api",
"targetRevision": "HEAD"
},
"images": ["myregistry.io/payment-api"]
}
]
}
}
}
Configuration
Configure this collector in your lunar-config.yml.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
find_command
|
Optional |
find . -type f \( -name '*.yaml' -o -name '*.yml' \)
|
Command to find candidate YAML files (must output one file path per line). |
correlate_by
|
Optional |
annotation,image,repoURL
|
Ordered, comma-separated correlation strategies (first match wins). Options annotation, image, tag, repoURL. |
component_annotation
|
Optional |
lunar.earthly.dev/component
|
Application annotation key that carries the source component id, for the annotation correlation strategy. |
image_registry_aliases
|
Required | — | Comma-separated old=new registry-host aliases used to normalize image references for the image correlation strategy. Empty disables normalization. |
tag_key
|
Required | — | Component meta/tag field that maps a component to its ArgoCD app name, for the tag correlation strategy. |
Documentation
View on GitHubArgoCD Deployment Tracking Collector
Pushes each ArgoCD Application's deployment posture from a central GitOps repo onto the service component it deploys, out-of-band.
Overview
Experimental. Runs on the repo that holds the ArgoCD files (a central GitOps repo), correlates each Application to the service component that builds its image (annotation, then image-match, then repoURL), and writes that app's deployment posture onto that service's Component JSON out-of-band, so the gitops/argocd policies evaluate on the service even though the ArgoCD config lives elsewhere. The write lands on the service's default-branch HEAD, so it only describes post-merge main and cannot gate PRs; use it for correlation and dashboards. Do not also run argocd-deployment-gate on the same service: both write .cd.gitops.applications and the hub appends across records, so pick one path per service.
Collected Data
This collector writes to the following Component JSON paths on each resolved service component (out-of-band):
| Path | Type | Description |
|---|---|---|
.cd.gitops.applications[] |
array | The Application(s) that deploy this service, copied from the GitOps repo |
.cd.gitops.source |
object | {tool: argocd, integration: external} |
.cd.gitops.linked_from |
string | The GitOps component the posture was pushed from |
Installation
Add to the GitOps repo's lunar-config.yml:
collectors:
- uses: github://earthly/lunar-lib/collectors/argocd-deployment-tracking@v1.0.0
on: ["domain:your-gitops-repo"]
# with:
# correlate_by: "annotation,image,repoURL"
Open Source
This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.