Knowledge graphSettings

Updated: May 11, 2026 at 12:45 PM

GitOps

medium

How to implement GitOps: desired state in Git, pull-based delivery, Argo CD/Flux, progressive delivery, and safe rollback.

GitOps is useful not as a slogan, but because it turns Git into a verifiable source of platform intent.

In real design work, the chapter shows how desired state, reconciliation, drift detection, rollback, and progressive delivery form a managed loop without manual cluster edits.

In interviews and engineering discussions, it helps explain GitOps through both its benefits and its costs: propagation delay, harder secret handling, and repository discipline.

Practical value of this chapter

Design in practice

Build a GitOps pipeline with a clear boundary between declared intent and reconciliation loops.

Decision quality

Define drift detection, rollback, and progressive delivery rules for safer releases.

Interview articulation

Explain how pull-based deployment improves auditability and reduces manual operational errors.

Trade-off framing

Highlight the costs: propagation delay, harder secret management, and strict repository discipline.

Foundation

Infrastructure as Code

GitOps does not replace IaC. It adds continuous reconciliation, verifiable changes, and controlled delivery.

Open chapter

GitOps is an operating model where platform state is managed through Git, and clusters are automatically brought to the desired state. Its core value is predictable, verifiable, and reproducible change in production.

This chapter treats Git as the source of intent, desired state as the platform contract, and reconciliation, drift, audit trails, policy as code, rollback, and progressive delivery as one engineering loop.

GitOps model

  • Git is the source of intent: the repository stores the desired state of the platform and applications.
  • Pull-based delivery means the in-cluster agent fetches changes from Git instead of waiting for an external push.
  • Every change goes through a pull request, checks, and an audit trail.
  • Drift between Git and the actual cluster state is detected automatically and corrected through continuous reconciliation.

Key building blocks

Continuous reconcile loop (desired state vs actual state)drift feedback

What it does

Separate app configs, platform baseline, and environment overlays so team ownership does not conflict.

Operational focus

Standardize directory structure and naming conventions before team scale-up.

Anti-pattern

Mixing app and platform changes in one layer makes reviews harder and increases blast radius.

In practice

Inside Argo: Automating the Future

Documentary context for Argo evolution and GitOps adoption in production platforms.

Open chapter

Industry tools

Argo CD

Role: Kubernetes GitOps controller and deployment orchestrator.

Best fit: Platforms with many services and clusters where UI, RBAC, app health, and project boundaries matter.

Strengths

  • Mature ecosystem with strong integration into Argo Rollouts and Argo Workflows.
  • The App of Apps pattern works well for large-scale application management.

Constraints

  • As application count grows, repository and project architecture must stay disciplined.
  • Needs clear sync windows, ownership boundaries, and multi-tenant policy practices.

Flux CD

Role: Git-close controller with a composable CRD model.

Best fit: Teams that want a lightweight approach, API-oriented automation, and deep Git/OCI workflows.

Strengths

  • Lightweight control plane and strong image update automation integration.
  • Composable architecture fits platform engineering scenarios well.

Constraints

  • Less out-of-the-box UI functionality than Argo CD.
  • Requires mature observability and careful operational runbooks.

Rancher Fleet

Role: GitOps management for large numbers of clusters.

Best fit: Organizations running dozens or hundreds of managed clusters, especially edge, retail, and geographically distributed estates.

Strengths

  • Strong focus on large-scale multi-cluster management.
  • Works well when Rancher is already the central cluster management layer.

Constraints

  • Most effective inside Rancher-centric platform ecosystems.
  • Needs a clear strategy for bundle decomposition and dependency control.

OpenShift GitOps

Role: Enterprise GitOps distribution built on top of Argo CD.

Best fit: OpenShift organizations that need integrated enterprise controls, support, and platform standardization.

Strengths

  • Integration with OpenShift RBAC, policies, and the platform lifecycle.
  • Lowers GitOps adoption cost for teams inside a unified platform.

Constraints

  • Strong coupling to the OpenShift platform model.
  • Architecture decisions need to align with the platform distribution release cycle.

Anthos Config Sync (Config Management)

Role: GitOps model for policies and Kubernetes fleets.

Best fit: Organizations that need centralized governance and declarative policy application at scale.

Strengths

  • Strong focus on governance, namespace boundaries, and policy-controller practices.
  • Useful for a unified compliance approach across large Kubernetes fleets.

Constraints

  • More pronounced dependence on a managed cloud ecosystem.
  • Policy repositories need clear ownership and an explicit exception workflow.

Companion toolchain

Progressive delivery

Tools: Argo Rollouts, Flagger

Enable canary and blue/green strategies through declarative rollout policies and metric checks.

Secrets in the GitOps loop

Tools: External Secrets Operator, SOPS, Sealed Secrets

Connect Git workflows to secret management without storing plaintext values in repositories.

Policy as code

Tools: OPA Gatekeeper, Kyverno, Conftest

Add mandatory guardrails before and after manifests reach the cluster.

Image update automation

Tools: Flux Image Automation, Renovate

Automate image tag updates through pull requests while preserving auditability.

How to choose the stack

  • If UI, application health visibility, and the Argo ecosystem are the priority, Argo CD is usually the first choice.
  • If teams want Git-close workflows, API-oriented automation, and composable controllers, Flux CD is often a strong fit.
  • For many clusters and edge scenarios, Rancher Fleet is commonly evaluated.
  • In platform distributions such as OpenShift or Anthos, the built-in GitOps stack is often the pragmatic default.

SRE

SRE and reliability

GitOps reduces manual production changes and improves traceability during incidents.

Open chapter

Operational practices

Use progressive delivery, canary releases, and blue/green deployment as normal release mechanics.

For incidents, use an emergency branch and a post-incident rollback pull request instead of manual fixes in the cluster.

Align secret handling with GitOps: encryption, external secret stores, and short-lived credentials.

Define ownership early: who owns platform environment overlays, and who maintains application manifests.

Practical checklist

  • All deployment changes are reproducible through pull requests without manual kubectl patches in production.
  • Drift monitoring and alerts exist when desired and actual state diverge.
  • Rollback procedures are explicit and tested during an incident drill.
  • There is an agreed promotion flow between development, staging, and production environments.
  • Secrets and sensitive values are not stored in Git in plaintext.

References

Related chapters

Enable tracking in Settings