Repository navigation
App-of-Apps: Preventing Cascade Sync Failures #26072
App-of-Apps: Preventing Cascade Sync FailuresQuestionIs there a way to prevent a single malformed manifest from blocking synchronization of all applications in an app-of-apps setup? ContextWe operate a multi-tenant GitOps platform using the app-of-apps pattern with apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-of-apps
spec:
source:
repoURL: https://github.com/org/repo.git
path: manifests
directory:
recurse: trueWhen one of our tenants introduces a malformed YAML (e.g., unquoted annotation value), the entire root Application fails to sync: This blocks all sibling Applications from syncing — one tenant's mistake impacts the entire platform. What We've Tried
QuestionAre there any built-in mechanisms or recommended patterns in ArgoCD that allow app-of-apps to:
Or is switching to ApplicationSet the only way to achieve fault isolation? Reproduction: https://github.com/fetidbell/app-of-apps-issue Thanks! |
Replies: 1 comment
|
@fetidbell there's no built-in "skip invalid" option. the repo-server's manifest generation is fail-fast by design. looking at the source, your best option: ApplicationSet with the git directories generator this gives you per-tenant fault isolation because each directory becomes its own Application resource. if apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: tenants
spec:
goTemplate: true
generators:
- git:
repoURL: https://github.com/org/repo.git
revision: HEAD
directories:
- path: manifests/*
template:
metadata:
name: 'tenant-{{.path.basename}}'
spec:
project: '{{.path.basename}}'
source:
repoURL: https://github.com/org/repo.git
targetRevision: HEAD
path: '{{.path.path}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{.path.basename}}'re: your concerns about ApplicationSet:
for error attribution (your question 3): even with the current app-of-apps setup, #3295 and #15521 have been open since 2019 requesting filepath info in errors. still unresolved. layered defense: pair the ApplicationSet migration with ref: ApplicationSet git generator docs | directory source docs |
@fetidbell there's no built-in "skip invalid" option. the repo-server's manifest generation is fail-fast by design.
looking at the source,
findManifests()callsgetObjsFromYAMLOrJSON()for each file, and if any file containsapiVersion:,kind:, andmetadata:but fails to parse, it returns aFailedPreconditionerror immediately, aborting the entire directory source. there's no recovery path.your best option: ApplicationSet with the git directories generator
this gives you per-tenant fault isolation because each directory becomes its own Application resource. if
tenants/teamA/has broken YAML, onlytenant-teamAerrors while everything else syncs fine: