The cluster was quiet until drift appeared. One command revealed it: kubectl.
Infrastructure as Code (IaC) promises consistency. But reality fights back. Configurations change outside your pipelines. Roles, labels, and resource specs shift. That gap between your IaC state and the live cluster is drift. Unchecked, it breaks deployments and security.
IaC drift detection is the work of catching these changes fast. With kubectl, you pull actual state from the cluster and compare it against your source of truth. The simplest drift detection starts with kubectl get or kubectl describe commands. They expose the live configuration. From there, diff it against your Git repo or your IaC files. You’ll see what changed, when, and — sometimes — why.
For Kubernetes, this is critical. A rogue kubectl apply can overwrite manifests. A manual edit in the dashboard can change pod specs without review. Even an automated job gone rogue can mutate your cluster silently. Drift detection means you find those changes before they cost you uptime.