ArgoCD Collector
Parses and validates ArgoCD Application, ApplicationSet, and AppProject manifests against the argoproj CRD schemas and writes a normalized .cd.gitops view for the gitops and argocd policies. Works for a central GitOps repo or a service that ships its own ArgoCD files.
argocd to your lunar-config.yml:uses: github://earthly/lunar-lib/collectors/argocd@v1.0.5
What This Integration Collects
This integration includes 1 collector that gather metadata from your systems.
parse
Scans the cloned repository for ArgoCD custom resources (argoproj.io/*), validates each against the argoproj CRD schemas, and writes a normalized, tool-agnostic view of the GitOps configuration, including:
- Applications and ApplicationSets (project, sync policy, destination, source)
- AppProjects (allowed source repos and destinations)
- Schema validity of each resource
- Whether Argo Rollouts (canary/blue-green) are referenced Raw, ArgoCD-specific resource shapes are preserved under .cd.gitops.native.argocd. Works for both a dedicated GitOps repo (many Applications) and a component repo that ships its own ArgoCD files.
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": "code"
},
"applications": [
{
"name": "payment-api",
"path": "apps/payment-api.yaml",
"valid": true,
"kind": "Application",
"project": "platform",
"component_annotation": "github.com/org/payment-api",
"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"],
"canary": {
"rollout": true
}
}
],
"projects": [
{
"name": "platform",
"path": "projects/platform.yaml",
"valid": true,
"is_default": false,
"source_repos": ["https://github.com/org/gitops.git"],
"destinations": [
{"namespace": "payments", "server": "https://kubernetes.default.svc"}
]
}
],
"native": {
"argocd": {
"applications": [
{"path": "apps/payment-api.yaml", "resource": {"apiVersion": "argoproj.io/v1alpha1", "kind": "Application", "spec": {}}}
],
"projects": [
{"path": "projects/platform.yaml", "resource": {"apiVersion": "argoproj.io/v1alpha1", "kind": "AppProject", "spec": {}}}
]
}
}
}
}
}
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). Used by the parse collector. |
Documentation
View on GitHubArgoCD Collector
Parses and validates ArgoCD Application, ApplicationSet, and AppProject manifests into a normalized .cd.gitops view.
Overview
This collector scans the cloned repository for ArgoCD custom resources (apiVersion: argoproj.io/*), validates each against the argoproj CRD schemas with kubeconform, and records a normalized, tool-agnostic view of the GitOps config under .cd.gitops on the repo's own component. It captures each Application's project, sync policy, destination, and source reference, plus the AppProjects that scope deployments, and preserves the raw resource shapes under .cd.gitops.native.argocd. The normalized data feeds the tool-agnostic gitops and ArgoCD-specific argocd policy sets. When the ArgoCD config lives in a separate repo, the companion argocd-deployment-tracking and argocd-deployment-gate collectors carry the posture cross-component (use one per service, not both).
Collected Data
This collector writes to the following Component JSON paths:
| Path | Type | Description |
|---|---|---|
.cd.gitops.source |
object | Tool/integration metadata (tool, integration) |
.cd.gitops.applications[] |
array | One entry per Application/ApplicationSet (name, path, valid, kind, project, sync_policy, destination, source_ref, canary) |
.cd.gitops.applications[].valid |
boolean | Whether the resource conforms to the argoproj CRD schema |
.cd.gitops.applications[].sync_policy |
object | Sync policy flags (automated, prune, self_heal) |
.cd.gitops.applications[].destination |
object | Deploy target (server, name, namespace) |
.cd.gitops.applications[].source_ref |
object | Manifest source (repoURL, path, targetRevision) |
.cd.gitops.projects[] |
array | AppProjects (name, valid, is_default, source_repos, destinations) |
.cd.gitops.native.argocd |
object | Raw, ArgoCD-specific parsed resources for advanced guardrail use |
Installation
Add to your lunar-config.yml:
collectors:
- uses: github://earthly/lunar-lib/collectors/argocd@v1.0.0
on: ["domain:your-domain"] # Or use tags like [gitops, kubernetes]
# with:
# find_command: "find ./gitops -type f -name '*.yaml'"
Open Source
This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Common Use Cases
Explore guardrails that use data from ArgoCD Collector.
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.