Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Desired State · GitOps

Direct answer

Desired state in GitOps is the configuration committed to the Git repository; the GitOps controller continuously works to make the live system match it.

When to use this

Use this when Git holds the desired state for GitOps.

First 30 seconds

1. Desired state = rendered manifests from git.

2. Agents compare with live state.

3. Diffs visible in UI/CLI.

4. Ignore fields managed by controllers.

5. Keep environments as overlays.

Operational verification

git → desired manifests → compare live

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
OpenGitOps Principles 1.0/current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformOpenGitOps Principles 1.0/current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when Git holds the desired state for GitOps.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Verify GitOps in three planes. Source verification shows the approved immutable revision and the declarative object path. Reconciler verification shows that the agent fetched/accepted that revision and reports its sync/reconcile status. Target verification independently reads the managed resource and application health. Include a negative check for stale revision: compare the controller-reported commit/digest to the current approved commit rather than trusting a generic 'synced' label. If rendering or overlays are involved, capture the resolved manifest/config digest so the path from source to applied object is auditable. After a remediation or new commit, wait for bounded reconciliation and confirm both desired/current equivalence for managed fields and the service-facing outcome.

Step 2 Common mistakes Narrow the fault
  • Desired state split between Git and UI settings.
Step 3 Where it fails Narrow the fault

The boundaries are source intent, rendering/dependency resolution, controller fetch/authentication, reconciliation/apply and target/application health. A commit can be correct while the agent cannot authenticate; the agent can reconcile a manifest that renders incorrectly for the environment; the resource can become current while its workload is unhealthy. Another boundary is ownership: resources or fields controlled by another operator should not be fought by GitOps. Diagnose from immutable revision outward and stop at the first layer whose expected state is not demonstrated. Do not make a direct target edit to 'fix' a source/render problem because the reconciler may reverse it. Correct the responsible layer, then verify the same revision propagates and the original consumer-facing check passes.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • The Git commit is the desired state.
  • The controller converges the cluster to it.
  • Changes start in Git.
Key checks
  • argocd app diff <app> — desired vs live
  • flux diff kustomization <name> --path <path> — Flux diff
  • Desired state per environment directory — structure
ReferenceWhy it matters1 section · depth on demand

In depth

In GitOps, desired state is exactly what is committed on the tracked branch and path of the repository — nothing else. The reconciler treats any difference in the cluster as drift to correct.

# Argo CD Application (excerpt)
spec:
  source:
    repoURL: https://git.example.com/platform/apps.git
    targetRevision: main
    path: envs/prod/web
  syncPolicy:
    automated: { prune: true, selfHeal: true }

prune removes resources deleted from Git; selfHeal reverts manual changes. Enable them only when everyone knows changes must go through Git.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

GitOps desired state is not merely 'configuration kept in Git'. The OpenGitOps model combines declarative intent with a versioned/immutable history, automated pull by software agents and continuous reconciliation of actual system state toward that intent. The desired-state revision is therefore an input to a reconciliation loop: source revision → agent fetch → render/resolve dependencies → compare actual → apply required changes → observe health/status. A repository can contain templates, overlays or generated sources, so the exact revision plus render inputs must be known before comparing it with runtime state. Git history supplies change lineage, while the reconciler supplies propagation and convergence state. A successful commit or merge shows neither that an agent consumed it nor that the target accepted or became healthy after the change.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Manage desired state through reviewed commits or equivalent immutable versions, protect the branches/paths that define production intent, and minimize direct imperative mutation of managed targets. Reconciler identities and repository credentials should be separated from human credentials and scoped to the resources they own. Treat generation steps, dependency versions and secret references as part of reproducibility; if the same commit can render differently because an external dependency floats, the declared state is not fully immutable in practice. Emergency target changes should be followed by an explicit decision: codify them into desired state or allow reconciliation to remove them. Monitor stalled reconciliation and stale revisions rather than assuming continuous operation. Decommission a GitOps-managed resource by changing intent, not by deleting it out of band and fighting the controller.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docOpenGitOps Principles 1.0/current 1.0/current

Authoritative/upstream documentation reviewed for bounded claims in GitOps > Desired State. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://opengitops.dev/ · confidence 94%
Embedded reference data

Quick lookup tables

GitOps → Desired State · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for GitOps → Desired State.

LayerGitOps → Desired State operational reference
Context identityOpenGitOps Principles 1.0/current + exact revision/input/target identity
Persistent intentVersioned contract/configuration with explicit ownership and prerequisites
VerificationValidate inputs/read current state → exercise bounded operation → independent target read-back
Output contractPreserve structured status/IDs/properties before human formatting
Failure boundarySeparate source/input/engine/controller execution from downstream target outcome
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Useful GitOps output ties every status to a revision. Capture source commit/digest, reconciliation generation, last attempted/applied revision, sync state, health state and any condition/reason from the controller. A green repository check does not equal reconciliation success, and 'Synced' does not necessarily mean the application is healthy. When the controller exposes a rendered diff, preserve it as an intermediate artifact and distinguish source differences from runtime drift. Avoid treating transient polling messages as final state; wait for the controller's observed generation/revision to match the desired generation and then read the target. For failures, retain the first condition and associated resource identity rather than only the final aggregated dashboard color.

Confirmation

Confirm action

Continue?