← Back to Home
πŸ—οΈ

Production GitOps: App of Apps & Best Practices

From one app to dozens across environments β€” cleanly and safely.

⏱10 min readπŸ“šDevOps Fundamentals

One Application is easy. Real organizations run dozens across dev, staging, and prod. This lesson covers the App of Apps pattern, how to structure your Git repos, and the practices that keep GitOps sane at scale.


🎯 Learning Objectives


The App of Apps Pattern

Instead of creating each Application by hand, you create one parent Application that itself points at a folder of child Application manifests. Argo CD then manages the children automatically.

text
root-app (Application)
└─ points at git path "apps/"
     β”œβ”€ app-frontend.yaml   (Application)
     β”œβ”€ app-backend.yaml    (Application)
     β”œβ”€ app-monitoring.yaml (Application)
     └─ app-argocd.yaml     (Application)  ← even Argo CD config itself

Now onboarding a new service is a single commit β€” add its Application YAML to apps/ and the root app syncs it into existence. This is how teams manage fleets of apps from one Git repo.


Structuring Your Repos

A common, clean layout separates what the app is from how each environment configures it, using Kustomize overlays:

text
my-app/
β”œβ”€β”€ base/                 # shared manifests
β”‚   β”œβ”€β”€ deployment.yaml
β”‚   β”œβ”€β”€ service.yaml
β”‚   └── kustomization.yaml
└── overlays/
  β”œβ”€β”€ dev/
  β”‚   └── kustomization.yaml   # e.g. 1 replica, debug on
  β”œβ”€β”€ staging/
  β”‚   └── kustomization.yaml
  └── prod/
      └── kustomization.yaml   # e.g. 5 replicas, resource limits

Each environment gets its own Argo CD Application pointing at the matching overlay path. The base stays DRY; overlays hold only the differences.

πŸ’‘ Config repo vs. app repo

A widely used practice is to keep application source code in one repo and the deployment manifests in a separate β€œconfig” repo. CI builds the image and bumps the image tag in the config repo; Argo CD sees the commit and deploys. This cleanly separates β€œbuild” from β€œdeploy”.


Production Best Practices

⚠ Secrets don't belong in plain Git

Never commit raw secrets. Use Sealed Secrets, External Secrets Operator, or a vault integration so the Git repo holds only encrypted or referenced secrets, not plaintext credentials.


Rollback the GitOps Way

Because Git is the source of truth, rollback is just Git:

bash
# revert the bad change β€” Argo CD re-syncs to the previous state
git revert <bad-commit>
git push

# or roll an app back to a previous revision directly
argocd app rollback my-app <history-id>

No special tooling, no snowflake procedure β€” the same workflow you already use for code.


πŸ§ͺ Hands-on Lab

πŸ“

Plan a Multi-Environment Setup

You have one service that must run in dev, staging, and prod with different replica counts. Describe: (1) how you’d structure the manifests, (2) how many Argo CD Applications you’d create, and (3) how a change would promote from staging to prod.


🧠 Knowledge Check

Knowledge Check

What is the App of Apps pattern?

Knowledge Check

In a GitOps workflow, how do you typically promote a change from staging to production?


πŸ’Ό Interview Preparation

Interview Q&A

How would you manage 30 microservices across three environments with Argo CD?


Summary

You’ve completed the Argo CD track: GitOps principles, installation, sync and self-healing, and scaling with App of Apps and solid production practices. You can now deploy and manage whole fleets of apps declaratively from Git. Next, we shift from deployment to debugging distributed systems with tracing in Zipkin.

Up Next

Introduction to Distributed Tracing with Zipkin

You've mastered this lesson. Continue your journey to becoming a DevOps Engineer.

Start Next Lesson→