Problem
Servers patched in place accumulate unique history. Over time no two are identical, failures cannot be reproduced, and a rollback restores neither the OS nor the packages that were changed along the way.
Also known as: immutable-servers, phoenix-servers
Never modify running servers; replace them with freshly built images for every change.
Servers patched in place accumulate unique history. Over time no two are identical, failures cannot be reproduced, and a rollback restores neither the OS nor the packages that were changed along the way.
With immutable infrastructure, a running server is a read-only artifact. If something must change, you build a new image, launch replacements and terminate the old servers. Containers made this the default, but it applies equally to virtual machines.
CI builds an image tagged with the commit. The deployment layer launches instances from it, waits for health checks, shifts traffic, and then destroys the previous generation.
commit --> CI --> image:v42
|
launch v42 instances --> health check --> add to LB
|
drain v41 instances <----------------------+
terminate v41
Anything that must survive replacement lives outside the instance: databases, object storage, attached volumes, or secrets fetched at startup.
Medium - image registry, temporary overlap capacity during rollout
Low - fewer snowflakes once pipeline exists
Medium - state externalisation discipline
Someone hand-patches a node, recreating drift
Local state is lost when an instance is replaced
Base image vulnerability is baked into the whole fleet