Interview Prep/Kubernetes/Deployments and rollouts

What is the difference between Recreate and RollingUpdate strategies and when would you pick Recreate?

BeginnerScenarioDeployments and rollouts
Answer

Situation read → A legacy app holds an exclusive lock on a ReadWriteOnce volume and cannot run two versions together.

What I'd do →

  1. Use strategy.type: Recreate for that Deployment
  2. Expect downtime: all old pods are terminated before new ones start
  3. Schedule the change in a maintenance window
  4. Confirm with kubectl get pods -w that the old pods are gone before the new ones appear

Why → RollingUpdate overlaps old and new pods. Apps that cannot tolerate two versions, or share a single-attach volume, need Recreate.

Interview tip → Mention that a StatefulSet or a proper RWX volume is often the better long-term fix.

All Kubernetes questions Roadmap: Kubernetes core

More on Deployments and rollouts