Immutable Infrastructure
In one line
Immutable infrastructure: never modify running servers — replace them entirely on any change. Ensures consistency and trivial rollback.
In simple words
Immutable infrastructure means you never modify a running server. Any change is done by creating a brand new server image and replacing the old servers. The old servers are discarded, never updated in place.
Benefits: consistency, no configuration drift, easy rollback (deploy previous image), reproducibility. This is the foundation of container-based deployments.
Example
# Build new image, deploy new containers
docker build -t my-app:v2 .
kubectl set image deployment/my-app app=my-app:v2
# Rollback? Just deploy the old image
kubectl rollout undo deployment/my-appBuild a new Docker image with changes. Deploy new containers from it. Never modify running containers. Rollback = deploy the old image.
Common confusions
Confused with: Infrastructure as Code
The difference: IaC defines infrastructure in code. Immutable infrastructure never modifies running instances. They work together: IaC creates the new image, immutability ensures it is never changed.
Related terms
Related Resources
Related Lessons
- Immutable Infrastructure
Immutable infrastructure.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.