This document describes the drift detection system that monitors for configuration drift between Git-declared manifests and the live Kubernetes cluster state.
The drift reporter (infrastructure/scripts/drift-reporter.sh) performs a weekly comparison:
- Reads all Kubernetes manifests from
infrastructure/k8s/ - Applies each manifest with
--dry-run=serverto get the desired state - Compares against the live cluster state via
kubectl get - Generates a JSON report with categorized drifts
| Severity | Resource Types | Action |
|---|---|---|
| Critical | StatefulSet, DaemonSet | Immediate alert, auto-remediation |
| High | Deployment | PR required, auto-issue created |
| Medium | ConfigMap, Secret, Service, Ingress | Weekly review |
| Low | HPA, PDB, others | Logged in report |
- Critical drift: Pager alert triggered, on-call investigates
- High drift: GitHub issue auto-created, assigned to infrastructure team
- Medium drift: Reviewed in weekly infrastructure sync
- Low drift: Noted in trend analysis
To remediate drift:
- Update the Git manifests to match desired state
- Or apply the live changes back to Git
- Run
bash infrastructure/scripts/drift-reporter.shlocally to verify