Interview Prep/Kubernetes/Deployments and rollouts

You need a blue/green deployment without a service mesh. How do you do it with plain Kubernetes?

IntermediateScenarioDeployments and rollouts
Answer

Situation read → The team wants instant cutover and instant rollback for a payments service.

What I'd do →

  1. Run two Deployments, app-blue and app-green, each with a version label
  2. Point the Service selector at version: blue
  3. Deploy and test green through a separate Service or port-forward
  4. Cut over with kubectl patch svc app -p '{"spec":{"selector":{"app":"app","version":"green"}}}'
  5. Keep blue running until you are confident, then scale it down

Why → A Service selector is evaluated continuously, so changing it re-points endpoints within seconds and the change is trivially reversible.

Interview tip → Mention the cost: you run double capacity during the window, and DB schema changes must be backward compatible.

All Kubernetes questions Roadmap: Kubernetes core

More on Deployments and rollouts