Compare rolling, blue-green and canary deployments. How do you decide which to use?
What the interviewer wants to hear
- Rolling replaces Pods gradually; cheap but mixed versions
- Blue-green switches traffic between two full environments; fast rollback, double cost
- Canary sends a small share of traffic and checks metrics
- Backward-compatible changes needed when versions overlap
- Choice depends on risk, cost, and observability maturity
Model answer
A rolling update replaces instances a few at a time. It needs no extra environment and is the Kubernetes default, but old and new versions run together and rollback means rolling again. Blue-green runs a full copy of the new version next to the old one and switches all traffic at once, so rollback is instant, but it costs double capacity during the release and all users move together. Canary sends a small percentage of real traffic to the new version, compares error rate and latency with the stable version, and increases traffic step by step, often automated with Argo Rollouts or Flagger. I choose rolling for low-risk services, blue-green when I need fast full rollback, and canary for high-traffic, high-risk services with good metrics. In all cases the database and APIs must stay backward compatible.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium DevOps Engineer questions
- How do you manage secrets such as database passwords and API keys across CI/CD pipelines and Kubernetes?
- A Pod is stuck in CrashLoopBackOff after a deployment. How do you troubleshoot it?
- Developers complain that the CI pipeline takes 40 minutes. How would you make it faster?
- How do you structure Terraform code for multiple environments like dev, staging and production?
- Your team is burning out from on-call pages. How would you redesign alerting and the on-call process?
- When would you package Kubernetes manifests with Helm and when with Kustomize? Can they be combined?
- Users report that one service on Kubernetes became slow since this morning. Walk me through how you would investigate.
- How would you promote a release from dev to staging to production in a GitOps setup with Argo CD?
- How do you include database schema migrations in a continuous delivery pipeline without causing downtime?