DevOps & CI/CD Deep Dive · 6 of 18

ArgoCD & Flux — GitOps for Kubernetes

GitOps inverts the deploy model: instead of CI pushing kubectl apply at the cluster, an in-cluster agent watches a Git repo and reconciles the live state to match. Rollbacks become git revert. Drift is visible. Auditing is automatic. ArgoCD and Flux are the two CNCF reference implementations.

Pull-basedReconciliationManifests in GitHelmKustomize
← Back to DevOps & CI/CD
The Idea

Pull, Don't Push

Basic Concepts

  • Desired state in Git — Kubernetes YAML / Helm values / Kustomize overlays committed to a repo.
  • Agent in the cluster — ArgoCD or Flux controller polls Git (or webhook), diffs against live state, applies changes.
  • Reconciliation loop — runs continuously, so manual changes (drift) get reverted or flagged.
  • Sync waves & hooks — order resources, run pre/post-sync jobs (DB migrations).
  • App of apps — one repo defines many apps; great for fleet management.
ArgoCD vs Flux

Two Flavors

AspectArgoCDFlux
UXPolished web UI showing live diff and topologyCLI-first; UI via third parties (Weave GitOps, Capacitor)
ModelApplication CRD; per-app sync configModular: GitRepository, Kustomization, HelmRelease CRDs
Multi-clusterSingle ArgoCD managing many clusters; ApplicationSetsOne Flux per cluster; pull is naturally distributed
Best forTeams that want a dashboard and self-serviceTeams that prefer composable controllers and cluster-local autonomy
Why GitOps

The Wins

  • Audit trail is free — every change is a commit by a known author.
  • Rollback is git revert — no special pipeline path.
  • No CI credentials in the cluster. The cluster reads Git; CI doesn't need kubeconfig.
  • Drift detection — see (and optionally auto-correct) hand-edits.
  • Disaster recovery — bootstrap a fresh cluster by pointing the agent at the Git repo.
Tradeoffs

What to Watch Out For

  • Secrets in Git need encryption — Sealed Secrets, SOPS, External Secrets Operator. Plain YAML won't do.
  • Image updates need a bridge — ArgoCD Image Updater or Flux's image automation; otherwise CI still has to commit a tag bump.
  • Two-system mental model. Engineers used to "CI deploys" can be confused that the cluster "pulls itself."
  • Repo-per-env vs mono-repo vs branch-per-env — there's no consensus pattern; pick early.
Continue

Other DevOps & CI/CD Tools