The Problem
ArgoCD ApplicationSet fails with generator errors. Applications are not created or are created incorrectly.
Root Cause
ApplicationSet generators fail when:
- Git repository is unreachable
- Directory path does not exist
- Template variables are undefined
- Generator produces empty results
Fix
Check ApplicationSet Controller Logs
kubectl logs -n argocd deployment/argocd-applicationset-controller --tail=100Common Fixes
Git generator β repository not found:
spec:
generators:
- git:
repoURL: https://github.com/org/repo.git
revision: HEAD
directories:
- path: "apps/*" # Ensure this path existsList generator β validate entries:
spec:
generators:
- list:
elements:
- cluster: production
url: https://kubernetes.default.svc
- cluster: staging
url: https://staging-cluster:6443Matrix generator β check both sub-generators independently first.
Validate Before Applying
# Dry-run to see what applications would be created
kubectl apply --dry-run=server -f applicationset.yaml