Course contentsShow
← Cloud and Infrastructure
Lesson 1168 of 2,98923. Kubernetes WorkloadsFree lesson

Recreate Strategy

Use the Recreate strategy to terminate all old pods before creating new ones, suitable for non-HA scenarios.

Recreate Strategy

What you'll learn: How to use the Recreate deployment strategy to completely replace old pods with new ones, suitable for scenarios that don't require continuous availability.


What is the Recreate Strategy?

The Recreate strategy is one of Kubernetes' deployment update methods. Unlike rolling updates that gradually replace pods, Recreate takes a "scorched earth" approach: it terminates all existing pods first, then creates new ones with the updated configuration.

Think of it like renovating a house. With a rolling update, you'd fix one room at a time while living there. With Recreate, you'd move out completely, demolish everything, rebuild from scratch, then move back in. There's downtime, but it's simpler and avoids any "mixed state" confusion.

When to Use Recreate

This strategy makes sense when:

  • High availability isn't critical — Your application can tolerate brief downtime
  • Old and new versions can't coexist — Maybe they use incompatible database schemas or shared resources
  • Simpler troubleshooting — Only one version runs at any time
  • Development or testing environments — Where interruptions are acceptable

How It Works

When you update a Deployment using Recreate:

  1. Kubernetes scales the old ReplicaSet down to 0 replicas
  2. All old pods terminate completely
  3. Only after all are gone, the new ReplicaSet scales up
  4. New pods with the updated configuration start running

You specify this in your Deployment manifest with strategy.type: Recreate.

Trade-offs

Downside: Your application will be completely unavailable during the transition — no pods are serving traffic between the old terminating and new starting.

Upside: You never have two versions running simultaneously, which simplifies state management and resource conflicts.

Key Takeaway: The Recreate strategy stops all old pods before starting new ones — simple but causes downtime, making it best for non-production or non-HA workloads where version coexistence would be problematic.