Kubernetes: Deployment Strategies Reference
Table of Contents
Section titled “Table of Contents”- Kubernetes Deployment Strategies
- Recreate
- Rolling Update (Default)
- Ramped / Slow Rollout
- Blue-Green
- Best-Effort Controlled Rollout
- Shadow Deployment
- Canary
- A/B Testing
- Rule of Thumb
Kubernetes Deployment Strategies
Section titled “Kubernetes Deployment Strategies”Kubernetes Deployment Strategies — Summary & Deeper Guidance
Section titled “Kubernetes Deployment Strategies — Summary & Deeper Guidance”This document summarizes common Kubernetes deployment strategies and adds practical depth around when, why, and how to use each safely in real systems.
Recreate
Section titled “Recreate”Traffic shift model: Cut-then-start (all old Pods terminated before new ones start)
Downtime risk: High (full outage)
Rollback effort: Very easy
K8s primitives / tools: Deployment with strategy.type: Recreate
Ideal use cases
- Local/dev or lab environments
- One-off jobs or batch workloads
- Breaking state resets or destructive migrations
Key caveats
- Guaranteed outage
- Fails readiness/liveness checks
- Unsuitable for any SLA/SLO-backed service
Rolling Update (Default)
Section titled “Rolling Update (Default)”Traffic shift model: Gradual Pod replacement
Downtime risk: Low (tunable)
Rollback effort: Easy (rollout undo)
K8s primitives / tools: Deployment with RollingUpdate, maxSurge, maxUnavailable
Ideal use cases
- Standard production services
- Stateless or lightly stateful apps
- Teams without service mesh
Key caveats
- Partial failures may hide until most traffic is shifted
- Slow for large fleets
- Requires good readiness probes
Ramped / Slow Rollout
Section titled “Ramped / Slow Rollout”Traffic shift model: Throttled rolling update with pauses Downtime risk: Very low Rollback effort: Easy K8s primitives / tools:
kubectl rollout pause/resume- Argo Rollouts manual steps
- GitOps promotion gates
Ideal use cases
- Mission-critical services
- Regulated or compliance-heavy systems
- Human-in-the-loop validation
Key caveats
- Operational overhead
- Requires on-call release ownership
- Slower time-to-market
Blue-Green
Section titled “Blue-Green”Traffic shift model: Instant switch between two identical environments Downtime risk: Zero (if readiness is correct) Rollback effort: Instant K8s primitives / tools:
- Two
Deployments - Service selector swap or Ingress routing
Ideal use cases
- Major version upgrades
- DB schema changes
- Compliance or audit-driven releases
Key caveats
- Doubles infrastructure cost
- Risk of stale “green” environment
- Requires strict cleanup discipline
Best-Effort Controlled Rollout
Section titled “Best-Effort Controlled Rollout”Traffic shift model: Aggressive rolling update Downtime risk: Moderate Rollback effort: Easy K8s primitives / tools:
Deploymentwith highmaxSurgeandmaxUnavailable(e.g., 100%/100%)
Ideal use cases
- Large stateless fleets
- Internal tools
- Speed prioritized over strict uptime
Key caveats
- Brief traffic drops possible
- Can violate SLOs under peak load
- Needs capacity headroom
Shadow Deployment
Section titled “Shadow Deployment”Traffic shift model: Mirrored traffic (responses discarded) Downtime risk: Zero Rollback effort: None needed K8s primitives / tools:
- Istio traffic mirroring
- Envoy filters
- Telepresence
Ideal use cases
- Performance testing with real traffic
- ML model validation
- Regression detection before release
Key caveats
- Double compute cost
- Must scrub PII
- No user-visible correctness signal
Canary
Section titled “Canary”Traffic shift model: Progressive traffic percentages (1% → 100%) Downtime risk: Very low Rollback effort: Very easy K8s primitives / tools:
- Argo Rollouts
- Flagger
- Istio
VirtualServiceweights
Ideal use cases
- Feature launches
- Risk-sensitive changes
- Error-budget-aware organizations
Key caveats
- Requires strong metrics and alerts
- Automation complexity
- Slower than pure rolling updates
A/B Testing
Section titled “A/B Testing”Traffic shift model: Attribute-based routing (user, cookie, header) Downtime risk: Very low Rollback effort: Moderate K8s primitives / tools:
- Service mesh or API gateway rules
- Feature-flag platforms
Ideal use cases
- UX and pricing experiments
- ML model comparison
- Personalization
Key caveats
- Requires analytics pipeline
- Risk of state leakage between variants
- Cohort cleanup needed post-test
Rule of Thumb
Section titled “Rule of Thumb”- Speed > uptime: Aggressive rolling
- Uptime > speed: Canary or slow rollout
- Zero-risk validation: Shadow
- Hard cutovers: Blue-green
- Experiments: A/B testing
- Never production: Recreate