Recreate Deployment: Downtime for a Clean Slate

The Recreate strategy is like flipping a switch: it shuts down all old pods before starting new ones. This guarantees downtime but is necessary for breaking changes, like a database migration. The footgun is a failed deployment leaves you with no running app.
WHY IT EXISTS Some application updates introduce breaking changes. If a new version of your code requires a database schema that the old version can't read, running both simultaneously would cause errors. The Recreate strategy solves this by ensuring only one version is ever active, preventing conflicts.
THE MENTAL MODEL Think of it as replacing a car's engine. You can't drive the car while the old engine is being removed and the new one is being installed. The car is completely out of service during the procedure. Similarly, the Recreate strategy takes the application completely offline to perform the update.
HOW IT WORKS When you trigger a deployment with the Recreate strategy, Kubernetes first scales the ReplicaSet managing the old pods down to zero. This terminates all running instances of your application. Only after all old pods are gone does it create a new ReplicaSet and scale it up, launching the new version of your pods. The service is unavailable from the moment the old pods are terminated until the new pods are up and ready to receive traffic.
WHEN TO USE IT Use this strategy in development environments for quick updates or in production for applications that can tolerate planned downtime. It's the correct choice when deploying breaking, non-backward-compatible changes, especially those involving data schema migrations or other stateful components where old and new versions cannot coexist.
WHEN NOT TO USE IT Avoid this strategy for any high-availability, user-facing service that requires zero downtime. Strategies like RollingUpdate or Blue-Green are designed for those scenarios. If a deployment fails, Recreate leaves you with no running application, making recovery more stressful and manual than with other strategies.
ONE CANONICAL EXAMPLE You are updating an e-commerce backend. The new version changes the orders database table, adding a required tracking_id column. The old code doesn't know about this column and would fail on writes. Using Recreate, you take the service down, apply the database migration, and then deploy the new code that understands the new schema. This prevents data corruption.
Read the original → kubernetes.io
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.