Rolling Deployment
A zero-downtime deployment strategy that gradually replaces old instances with new ones in controlled batches rather than all at once
Table of Contents
Structure Diagram
What is Rolling Deployment?
A zero-downtime deployment strategy that gradually replaces old instances with new ones in controlled batches rather than all at once. It is a core concept in Deployment Strategies within Cloud / DevOps.
Core Principles
Rolling Deployment updates a fleet of running instances by incrementally replacing old version (v1) nodes with new version (v2) nodes in controlled batches instead of taking the whole service offline. Each new instance must pass health checks before an old instance is drained and terminated.
Because it does not require provisioning a full duplicate environment like Blue-Green Deployment, Rolling Deployment is cost-efficient and serves as the default update strategy (RollingUpdate) in Kubernetes Deployments.
Practical Takeaways
- Tune
maxSurgeandmaxUnavailable: For capacity-sensitive workloads, setmaxUnavailable: 0andmaxSurge: 25%so new replicas become ready before any existing replica is terminated. - Combine Readiness Probes with Graceful Shutdown: Prevent 502 errors during pod churn by routing traffic only after readiness probes pass and draining in-flight requests cleanly via
SIGTERMandpreStophooks. - Design for N-1 version compatibility: Because
v1andv2serve traffic concurrently during rollout, keep database migrations, cache keys, and API contracts backward-compatible.
Notable Examples
- Kubernetes Deployments: Standardizes rolling updates with built-in revision history, progress deadlines, and
kubectl rollout undo. - AWS ECS & EC2 Auto Scaling: Uses
minimumHealthyPercentandmaximumPercentto rotate tasks and instances automatically. - Stateless Microservice APIs: Widely used for frequent daily releases without doubling compute spend.