Q: Your deployment has 10 replicas. You need to do a zero-downtime deploy of a new version. How do you configure and verify it?
Configure RollingUpdate strategy:
#Kubernetes #Deployments & Workloads #L3 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
""Kubernetes is a declarative desired state system; understanding the reconciliation loop is how you diagnose this quickly. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
Configure RollingUpdate strategy:
kubectl rollout status deployment/— watch it progress.- Monitor your health endpoint / app metrics during rollout.
- If something goes wrong:
kubectl rollout undo deployment/.
2️⃣
Remediation & Permanent Safeguards
maxUnavailable: 0 ensures old pods aren't removed until new ones pass readiness probes. Verify: Also make sure your readiness probe is accurate — this is the gating mechanism for zero-downtime. A bad probe that returns ready too early defeats the whole strategy.
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2 # max extra pods during update
maxUnavailable: 0 # never kill old pod before new one is ready
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: kubectl rollout status deployment/ — watch it progress.."
⚡ 60-Second Elevator Pitch Talking Points
- kubectl rollout status deployment/ — watch it progress.
- Monitor your health endpoint / app metrics during rollout.
- If something goes wrong: kubectl rollout undo deployment/.
Advertisement