Automation · GitOps
Drift Detection
Cheat sheet · https://pcornel.dk/topic.php?topic=5488
Answer
Drift detection in GitOps is done by the controller comparing live resources with Git, showing OutOfSync status in Argo CD or Flux and optionally correcting it automatically.
Remember
- OutOfSync means live differs from Git.
- Find who changed the live resource.
- Self-heal can revert automatically.
First checks
argocd app list | grep OutOfSync— drifted appsflux get kustomizations | grep -v True— not ready- selfHeal enabled — auto-correct
Commands
kubectl edit
Verify in this order
live change → drift detected → self-heal/alert
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5488