Interview Prep/Kubernetes/Deployments and rollouts

What is a ReplicaSet and why do you rarely create one directly?

BeginnerScenarioDeployments and rollouts
Answer

Situation read → A new teammate asks why kubectl get rs shows several ReplicaSets for one Deployment.

What I'd do →

  1. kubectl get rs -l app=web to list them
  2. Note that old ReplicaSets are scaled to 0 and kept for rollback
  3. kubectl describe rs <name> shows the owner Deployment
  4. Limit the clutter with revisionHistoryLimit: 5

Why → A Deployment owns one ReplicaSet per pod-template revision. Rolling updates are just scaling one up and another down.

Interview tip → Say you always create Deployments, which add rollout and rollback on top of ReplicaSets.

All Kubernetes questions Roadmap: Kubernetes core

More on Deployments and rollouts