DevOps/CI-CD

GitOps

GitOps is an operational framework that uses Git repositories as the single source of truth for declarative infrastructure and application configuration with automated reconciliation.

What is GitOps?

GitOps is an operational framework that uses Git repositories as the single source of truth for declarative infrastructure and application configuration with automated reconciliation. Every change to infrastructure or applications flows through Git pull requests, providing audit trails, peer review, and rollback via git revert. ArgoCD and Flux are the dominant GitOps controllers for Kubernetes environments, continuously synchronizing cluster state with repository definitions.

How does GitOps work?

GitOps operates on a pull-based reconciliation model. An operator agent running inside the cluster continuously monitors a Git repository for changes. When a new commit appears — whether from a human merge or an automated pipeline — the operator compares the desired state in Git against the actual cluster state and applies the necessary changes.

The workflow typically follows this pattern: a developer opens a pull request modifying Kubernetes manifests, Terraform files, or Helm charts. After peer review and CI validation, the PR merges. The GitOps controller detects the change within seconds, applies it to the target environment, and reports synchronization status.

Drift detection continuously verifies that deployed resources match Git definitions. If someone manually modifies a resource (via kubectl or console), the controller reverts it to match the declared state, enforcing Git as the authoritative source. This self-healing behavior prevents configuration drift that plagues manually managed systems.

Why does GitOps matter?

GitOps provides complete auditability — every infrastructure change has an author, timestamp, review, and revert path through Git history. Recovery from disasters becomes a git revert followed by automatic reconciliation. For ML platforms, GitOps manages model deployment manifests, ensuring model versions in production are always traceable to specific Git commits.

Best practices for GitOps

  • Separate application repositories from GitOps configuration repositories to avoid circular triggers
  • Implement branch-per-environment patterns or directory structures for promoting changes across stages
  • Use sealed secrets or external secret operators to keep sensitive values out of Git while maintaining declarative management
  • Configure health checks and sync windows to prevent automated changes during maintenance periods
  • Set up notifications for sync failures so drift detection issues are addressed promptly

About the Author

Aaron is an engineering leader, software architect, and founder with 18 years building distributed systems and cloud infrastructure. Now focused on LLM-powered platforms, agent orchestration, and production AI. He shares hands-on technical guides and framework comparisons at fp8.co.