Re-architecting Argocd Monorepos for Golden Applications in 2026
Adopt a layered monorepo structure with Kyverno for policy enforcement, ServerSideApply.
Adopt a layered monorepo structure with Kyverno for policy enforcement, ServerSideApply, and clear separation of infrastructure and application workloads to maintain golden state integrity.
Golden applications require operational discipline, not just tooling. A monorepo for ArgoCD must balance flexibility for diverse workloads (infra, web apps, custom services) while preventing drift through policy-as-code and declarative automation.
Actionable Workflow
-
Define Boundaries
- Split manifests into
infra/andapps/directories. - Use Kustomize overlays for environment-specific tweaks (e.g.,
dev/,prod/). - Enforce naming conventions:
cluster-addons/argocd,apps/django-service.
- Split manifests into
-
Policy-Driven Governance
- Deploy Kyverno with
failandwarnpolicies for critical requirements (e.g., image updates, resource limits). - Apply
ServerSideApply: trueandsync-wavelabels to manage dependency order.
- Deploy Kyverno with
-
Automate Drift Detection
- Use ArgoCD Image Updater with
imageGenerationsto track base image changes. - Integrate with External Secrets Operator for secure secret management.
- Use ArgoCD Image Updater with
-
Validate Sync Order
- Annotate critical applications with
argoproj.io/sync-wave: "1"to ensure infra deploys first. - Test policy conflicts in staging before prod.
- Annotate critical applications with
Policy Example: Enforce POD_ID for Observability
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: enforce-pod-id-env
spec:
validationFailureAction: fail
rules:
- name: check-pod-id
match:
resources:
kinds:
- Pod
validate:
message: "POD_ID environment variable is required"
pattern:
spec:
containers:
- env:
- name: POD_ID
value: "*"
Tooling Stack
- ArgoCD: Deploy with
--set server.args={'--server-side-apply','--sync-wave'}. - Kyverno: 1.7+ for SSA compatibility and policy dry-run.
- External Secrets Operator: Sync secrets from AWS Secrets Manager or Vault.
- Kustomize: Manage overlays without duplicating manifests.
Tradeoffs & Caveats
- Complexity: Kyverno policies add evaluation latency; test in non-prod first.
- False Positives: Overly strict policies can block valid workloads (e.g., debug containers).
- Sync Conflicts: Misordered
sync-wavelabels may cause transient failures.
Troubleshooting Common Issues
- Stuck Syncs: Check ArgoCD logs for
pre-sync-wavefailures. Ensure infra apps (e.g., cert-manager) are in wave 1. - Policy Violations: Use
kyverno get generatingpoliciesto debug conflicting rules. - Image Updater Conflicts: Disable for apps with custom image promotion workflows.
In 2026, the goal isn’t a “perfect” monorepo—it’s one that enforces guardrails without stifling teams. Start with policy-as-code for non-negotiables (security, observability), automate the rest, and accept that edge cases will require manual exceptions.
Source thread: It’s 2026. Golden Applications and if you could re-write the argocd monorepo what pattern would you use?

Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email