
Continuous
In GitOps, reconciliation is continuous — an ongoing loop that ensures the running system matches the declared configuration. Continuous reconciliation reacts to changes (for example, pod crashes or ad-hoc manual edits) and restores the desired state automatically. Think of it like a thermostat: it constantly observes the environment and adjusts until the setpoint is reached. Continuous reconciliation reduces operational toil and improves resiliency by continuously observing, comparing, and correcting the cluster state.
Declarative
Declarative configuration states what you want the system to look like (the desired state), not how to get there. A GitOps operator is responsible for making the cluster match that description. Imperative commands execute specific API calls and steps; declarative manifests describe the intended outcome. Imperative example (direct commands):service.yml)
deployment.yml)
- Flux: https://learn.kodekloud.com/user/courses/gitops-with-fluxcd
- Argo CD: https://learn.kodekloud.com/user/courses/gitops-with-argocd
Keeping the desired state in Git enables code review, CI checks, and an auditable history of configuration changes — essential for collaborative operations and compliance.
Desired state
The desired state is the canonical description of how your system should behave. A repository commonly contains a directory likemanifests/ with YAML files for Deployments, Services, ConfigMaps, Ingresses, and more. Those files collectively define the desired state of your application and its infrastructure.
Example repository tree:
manifests/deployment.ymlmanifests/service.ymlmanifests/configmap.ymlmanifests/ingress.yml
- It provides a single, reviewable definition of intent.
- Enables reproducible environments across clusters and teams.
- Makes it possible to detect and correct divergences.

State drift
State drift happens when the actual cluster state diverges from the desired state in Git. Drift leads to unexpected behavior, complicates troubleshooting, and can open security or stability gaps. Example scenario:- Desired state in Git specifies 5 replicas for a Deployment (declared in
deployment.yml). - Someone runs an imperative command that scales the Deployment to 3 replicas.
Avoid ad-hoc imperative changes in production clusters. They create drift that breaks the one source of truth model and can undermine automated reconciliation.
State reconciliation
State reconciliation detects drift and brings the actual state back in line with the desired state. Reconciliation is the GitOps control loop: Observe -> Diff -> Act.- Observe: the operator reads desired manifests from Git and inspects the running cluster.
- Diff: it computes the differences between desired and actual states.
- Act: it applies the needed changes to reconcile the cluster to the declared state.
- Self-healing: automatic correction improves availability.
- Consistency: ensures the running system matches declared configuration.
- Reduced manual intervention: operators fix drift without human action.

GitOps-managed software system
A GitOps-managed software system is any system (Kubernetes clusters, applications, or infrastructure) controlled via GitOps principles. The Git repository becomes the single source of truth for namespaces, RBAC, Helm charts, deployments, services, and add-ons (for example Prometheus). All changes are made by editing the repository; a GitOps operator ensures those changes are applied automatically.
State store
The state store is the centralized repository holding the definitive desired state—most commonly Git. It contains all configuration and manifests, and acts as the authoritative record of system intent. Why a state store matters:- Single source of truth: Git is the authoritative record of system state.
- History and audit: every change is tracked and reviewable.
- Collaboration: teams use pull requests, code review, and branching workflows.

Feedback loop
The feedback loop closes the cycle between deployment and operation. It uses observability signals (metrics, logs, alerts) to inform stakeholders and to trigger fixes or rollbacks in Git. Typical feedback flow:- GitOps operator deploys a new version from Git.
- Monitoring (Prometheus) detects increased error rates.
- Visualization (Grafana) surfaces the issue.
- Alertmanager sends notifications (email, Slack).
- Teams revert or fix the change in Git, triggering reconciliation back to a healthy state.

- Detect problems early using automated observability.
- Close the loop from runtime signals back to the desired configuration.
- Iterate quickly and safely using operational data.
Rollback
Rollbacks let you quickly undo problematic changes, either manually via Git or automatically via GitOps tooling. Common rollback methods:| Method | When to use | Example |
|---|---|---|
| Git revert | Manual, precise undo while preserving history | git revert <commit-hash> |
| Automated rollback | Configure GitOps tool to revert on failed health checks or failed deploys | Argo CD or Flux health/rollback configurations |

- Rapid recovery from bad deployments or configuration mistakes.
- Minimizes downtime and service disruption.
- Encourages frequent deployments by providing a reliable safety net.
Key terms at a glance
| Term | Short definition |
|---|---|
| Continuous reconciliation | Ongoing loop that observes, diffs, and acts to keep systems aligned with Git |
| Declarative | Configuration style that specifies desired end state (YAML manifests) |
| Desired state | The canonical configuration stored in the state store (usually Git) |
| State drift | When actual cluster state differs from the desired state |
| State reconciliation | Process to detect drift and restore desired state |
| State store | Central repository of manifests (typically Git or OCI registries) |
| Feedback loop | Observability-driven cycle that informs changes in Git |
| Rollback | Reverting to a previous known-good state via Git or tooling |
Summary
- GitOps uses Git as the single source of truth for declarative configuration.
- Continuous reconciliation (Observe → Diff → Act) keeps actual state aligned with desired state.
- Declarative manifests express intent; GitOps operators apply and maintain that intent automatically.
- State drift is detected and corrected through reconciliation.
- The state store (usually Git) enables collaboration, history, and reproducibility.
- Feedback loops and rollbacks provide operational safety and enable rapid, reliable iteration.
Links and References
- Flux: https://learn.kodekloud.com/user/courses/gitops-with-fluxcd
- Argo CD: https://learn.kodekloud.com/user/courses/gitops-with-argocd
- Helm basics: https://learn.kodekloud.com/user/courses/helm-for-beginners
- Prometheus, Grafana, Alertmanager: https://learn.kodekloud.com/user/courses/aiops-foundations-intelligent-monitoring-with-prometheus-grafana
- Kubernetes concepts: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/