Use this when using Argo CD or Flux for Kubernetes.
GitOps · Kubernetes Automation
GitOps for Kubernetes stores manifests or Helm values in Git and uses Argo CD or Flux in the cluster to sync them automatically and show drift.
1. GitOps for Kubernetes: Argo CD or Flux reconcile manifests from git.
2. Auto-sync with self-heal.
3. Secrets via external managers.
4. Promotion via PRs.
5. Observe sync health.
git → agent → cluster
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as schema drift, selector overreach, admission rejection, controller lag, immutable fields, stale status and confusing created object with ready workload, choosing the cases most relevant to declarative Git state, controller reconciliation, drift detection, prune behavior and health/readiness beyond sync status.
Step 2 Example Narrow the fault
argocd app get myapp
flux get all -A
Step 3 Common mistakes Narrow the fault
- Manual
kubectl editchanges reverted by the controller.
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.
- Argo CD or Flux sync manifests from Git.
- Auto-sync and self-heal keep the cluster in line.
- Drift is shown as OutOfSync.
argocd app list— sync statusflux get kustomizations -A— Flux- Repo per environment structure — organisation
ReferenceWhy it matters1 section · depth on demand
What it is
GitOps on Kubernetes uses Argo CD or Flux to sync manifests from Git into the cluster.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
GitOps for Kubernetes stores all manifests, Helm values and Kustomize overlays in Git, and a controller in the cluster (Argo CD or Flux) continuously applies them. Engineers change the cluster by merging pull requests instead of running kubectl apply.
# Argo CD Application
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: net-tools, namespace: argocd }
spec:
source:
repoURL: https://git.example.com/platform/net-tools.git
path: envs/prod
targetRevision: main
destination: { server: https://kubernetes.default.svc, namespace: net-tools }
syncPolicy:
automated: { prune: true, selfHeal: true }
Benefits: full audit trail, easy rollback with git revert, and identical clusters from the same repository. Cluster credentials stay inside the cluster; CI pipelines no longer need admin access.
Mechanics
The linked authority for bounded mechanics is OpenGitOps — Principles; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Kubernetes Automation > GitOps. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://opengitops.dev/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For declarative Git state, controller reconciliation, drift detection, prune behavior and health/readiness beyond sync status, prefer typed fields and stable IDs over human presentation text.