Configuration Drift
partialSummary
Production configuration diverges from the intended state through manual changes, partial rollouts, and environment-specific overrides, causing failures that are intermittent, hard to reproduce, and require cross-node comparison to diagnose.
Description
Configuration drift occurs when the actual configuration of a running system diverges from what is documented, version-controlled, or believed to be in effect. Drift accumulates through a pattern of small changes: an incident triggers a manual adjustment directly on one server ("just for now"), the adjustment is not documented, the next deployment does not include it, and the production state and code state diverge silently.
Partial rollout drift: a configuration change is rolled out to 70% of nodes during a maintenance window but the rollout is interrupted. Now 70% of nodes run the new configuration and 30% run the old one. The system works but is in an internally inconsistent state. Failures occur only when requests hit the minority nodes.
Environment-specific override drift: a configuration override is added to fix a production-specific issue. The override is not reflected in the infrastructure-as-code repository. Six months later, the same configuration key is changed in the repository, the override is wiped, and the original issue reappears.
The insidious property of config drift: failures are condition-dependent. A node with wrong max_connections fails only under traffic spikes. The nodes with correct configuration handle the same spike fine. This makes the failure appear non-deterministic and hard to reproduce in investigation.
Detection without tooling is difficult. An engineer investigating a production incident cannot easily compare the configuration of 30 nodes. Without a source of truth (Ansible, Terraform, Puppet), there is no basis for comparison. Configuration management tools detect drift by comparing actual state against desired state defined in code: this is their primary operational value.
Immutable infrastructure eliminates drift by replacing rather than mutating running instances. A configuration change produces a new AMI or container image; all instances of the old image are terminated and replaced. No in-place mutation means no drift can accumulate. Kubernetes deployments follow this model by default.
GitOps: all configuration state is expressed in git. A controller (ArgoCD, Flux) continuously applies the git state to the cluster, reconciling drift automatically. Unauthorized manual changes are overwritten on the next sync.
Characteristics
Triggers
- ·Manual configuration change applied directly to a production node without code update
- ·Partial rollout of configuration change interrupted before completion
- ·Environment-specific override not captured in configuration management
- ·Configuration management tool run skipped during incident response
- ·Different configuration applied to different deployment regions or AZs
Detection Signals
Mitigation Strategies
Package configuration into container images or AMIs. Configuration changes produce a new image version; all instances are replaced with the new version. No in-place mutation means no drift surface. Kubernetes deployments naturally implement this.
Store all configuration in git. A GitOps controller (ArgoCD, Flux for Kubernetes; Ansible Tower for host-level config) continuously compares git state against running state and applies corrections. Manual changes are overwritten at the next sync cycle (typically within minutes).
Run Ansible/Puppet/Chef in check/dry-run mode on a schedule (every 30 minutes). Alert when drift is detected. This does not auto-remediate but provides early detection before condition-dependent failures occur.
Recovery Steps
- 1.Identify the scope of drift: which nodes are affected and what configuration differs
- 2.Compare actual configuration against desired state in repository using config management tool
- 3.For immediate fix: run configuration management against drifted nodes to converge state
- 4.For immutable infrastructure: roll out a new deployment to replace drifted instances
- 5.Document what change caused the drift and add to postmortem
- 6.Add automated drift detection to prevent recurrence
Estimated recovery time: Identifying the drift and scope: minutes to hours depending on tooling. Applying configuration correction: minutes (automated) to hours (manual). For immutable infrastructure: deployment time (typically 15–60 minutes).
Affected Systems
Patterns
Technologies
Basis
Common operational failure in non-immutable infrastructure; mitigations are well-established in DevOps practice
Run This Failure
Blast radius analysis for this failure mode within each scenario that carries it.
Used In Architecture Scenarios
Multi-Tenant SaaS
A multi-tenant API gateway providing authentication, distributed rate limiting, request routing, payload transformation, and per-tenant usage analytics for API publishers. The hot path: authentication check, rate limit evaluation, and routing decision: must complete in under 1ms using Redis-only data structures to avoid proxying latency dominating upstream service response time. PostgreSQL stores tenant configuration, subscription plans, and API key definitions. Kafka receives API usage events for downstream billing and analytics. Configuration changes (rate limit updates, routing rule edits) must propagate to all gateway replicas without restart.
Multi-Tenant SaaS
A multi-tenant developer tooling platform providing CI/CD pipeline execution, log aggregation, code analysis, and dependency scanning across isolated tenant organizations. Tenant isolation is the primary correctness constraint: a security boundary violation between tenants is a critical incident, not a performance event. PostgreSQL row-level security enforces data isolation; Redis manages job queues and distributed locks; Elasticsearch indexes pipeline log output for search; Kafka delivers webhook events to tenant-registered endpoints; MinIO stores pipeline artifacts. Resource quota enforcement prevents any single tenant's burst from affecting others.
Financial Ledger
An electronic health record (EHR) architecture built around strict auditability, HIPAA compliance, and append-only correctness. Clinical records are mutable by design (amendments, addenda) but corrections must be explicitly attributed, not silently overwritten. Event sourcing provides a reconstructable audit log; PostgreSQL row-level security enforces patient-level access control at the database layer; Kafka streams HL7 FHIR events to downstream clinical systems. The architecture must support breach detection, access auditing, and state reconstruction at any historical point: not just current state retrieval.