Deployment Strategy Selection Framework¶
A Deployment Strategy Selection Framework is used to determine the most appropriate method for releasing software updates based on project constraints such as downtime tolerance, resource availability, and risk management.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]
Selecting the right strategy allows teams to balance technical innovation with market needs, minimizing service disruption while enabling rapid iteration^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Key Selection Criteria¶
When choosing a deployment strategy, teams typically evaluate the following trade-offs:
- Downtime Tolerance: Strategies like Recreate involve significant downtime, whereas Rolling, Blue/Green, and Canary aim for zero downtime^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Resource Cost: Blue/Green and Shadow deployments require double the infrastructure resources to run parallel environments^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Rollback Capability: Strategies like Blue/Green allow for instant rollbacks by switching traffic back, while Rolling deployments can be slow to revert if a failure is detected late in the process^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Traffic Control: Canary and A/B Testing offer granular control over traffic distribution (e.g., sending 10% of users to a new version), whereas Recreate offers no traffic routing during deployment^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Common Strategies¶
Recreate (Rebuild)¶
The application is completely shut down before the new version is started^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Easy to set up; no extra load on hosts during deployment^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: High downtime; significant user impact^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Rolling Update (Ramped)¶
New versions are deployed incrementally, replacing instances of the old version one by one (or in batches)^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Zero downtime; more resource-efficient than Blue/Green^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: Slow rollout/rollback; mixed versions running simultaneously can complicate debugging^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Blue / Green Deployment¶
The new version ("Green") is deployed alongside the existing version ("Blue"). Once tested, traffic is switched from Blue to Green instantly^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Instant rollout and rollback; zero downtime; avoids version conflicts^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: High resource cost (requires double capacity); potential issues with in-flight transactions during the switch^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Canary Deployment¶
A small percentage of traffic is routed to the new version to verify stability before a full rollout^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Fast rollback; allows for debugging with real users on a small scale^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: Slow overall release process; requires backward compatibility between versions^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
A / B Testing¶
Multiple versions run simultaneously, with traffic routing based on specific parameters (cookies, geography, etc.) rather than just weight^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Precise control over user segments; useful for validating business features^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: Requires advanced load balancing and distributed Tracing to debug effectively^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Shadow Deployment¶
Real traffic is mirrored to the new version, but users do not receive responses from it. This allows for testing against production loads without user impact^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Pros: Safe performance testing; no user impact^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
- Cons: High resource cost; complex configuration; risk of unintended side effects (e.g., duplicate orders in e-commerce)^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md].
Sources¶
^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]