Opscraft
GitOps with Flux & Argo CD · Lesson 1 of 6 · 3 min read

GitOps principles

GitOps is how most modern Kubernetes platforms deploy: Git holds the desired state and an in-cluster controller continuously reconciles the cluster to it. Running Flux in production is a real strength — interviews will test whether you understand it beyond "it syncs Git", and will often ask you to compare it with Argo CD, design a multi-cluster repo layout, handle secrets, promote between environments, automate image updates, and recover from failures.

The four principles (OpenGitOps)

  1. Declarative — the whole system is described declaratively.
  2. Versioned and immutable — desired state is stored in a way that keeps history (Git).
  3. Pulled automatically — agents pull desired state from the source.
  4. Continuously reconciled — agents observe actual state and correct drift.
Enlarge diagramDeclarativethe whole systemas YAMLVersionedGit history,immutablePulledagents in thecluster fetch itReconcileddrift correctedcontinuously
Figure 1. The four GitOps principles in one loop: describe it, version it, let the cluster pull it, keep correcting drift.
Swipe sideways to see all of it, or tap to open it full screen.

Push vs pull deployment

Push (CI runs kubectl/helm) Pull (GitOps controller)
Credentials CI needs cluster-admin-ish credentials Cluster pulls from Git; CI needs only Git write
Drift Not detected Detected and corrected continuously
Audit CI logs Git history = deployment history
Rollback Re-run old pipeline git revert
Multi-cluster CI must reach every cluster Each cluster pulls its own config — works behind firewalls/private endpoints
Visibility Pipeline status Controller status, health, events
Enlarge diagramPUSH: CI DEPLOYSPULL: GITOPSCI pipelineholds kube credsclusterCI pipelinewrites Git onlyGit repodesired stateFluxin the clusterkubectldrift unseen · CI reaches every clustercommitpull
Figure 2. Push vs pull. In GitOps, CI only writes to Git; the cluster pulls its own desired state, so CI never holds cluster credentials.
Swipe sideways to see all of it, or tap to open it full screen.

CI builds and tests; GitOps deploys. CI's last step is updating the GitOps repo (or an image automation controller does it).