Canary Deployment Cheat Sheet
Techniques for gradually shifting production traffic to a new version while monitoring metrics to catch regressions early.
2 PagesAdvancedFeb 10, 2026
Core Concept
How canary releases limit blast radius.
- Canary- A small subset of instances running the new version, receiving a small percentage of traffic
- Baseline- The stable version still serving the majority of traffic during the canary phase
- Progressive rollout- Gradually increasing the canary's traffic share (e.g. 5% -> 25% -> 50% -> 100%) as confidence grows
- Automated analysis- Comparing canary vs baseline metrics (error rate, latency) to auto-promote or auto-rollback
- Blast radius- The scope of users affected if the new version has a defect; canary keeps it small initially
- Feature flags- Often paired with canaries to decouple deployment from feature exposure
Nginx Weighted Canary
Split traffic between stable and canary upstreams by weight.
nginx
upstream backend { server 10.0.0.1:3000 weight=9; # stable, ~90% server 10.0.0.2:3000 weight=1; # canary, ~10%}server { listen 80; location / { proxy_pass http://backend; }}
Kubernetes Canary (replica ratio)
Approximate traffic split via replica counts behind one Service.
yaml
# stable: 9 replicas, canary: 1 replica -> Service load-balances ~90/10apiVersion: apps/v1kind: Deploymentmetadata: name: myapp-stablespec: replicas: 9 selector: matchLabels: {app: myapp} template: metadata: labels: {app: myapp, track: stable}---apiVersion: apps/v1kind: Deploymentmetadata: name: myapp-canaryspec: replicas: 1 selector: matchLabels: {app: myapp} template: metadata: labels: {app: myapp, track: canary}
Metrics to Watch
What to monitor before promoting a canary.
- Error rate- HTTP 5xx rate on canary compared to baseline over the same window
- Latency (p95/p99)- Tail latency regressions often surface before average latency does
- Saturation- CPU/memory/connection pool usage on canary instances
- Business metrics- Conversion rate, checkout success, etc., for user-facing regressions that infra metrics miss
Pro Tip
Automate the rollback decision based on statistically significant metric deltas (not just eyeballing a dashboard) — tools like Flagger or Argo Rollouts can halt and revert a canary the moment error rates spike, faster than any human on-call.
Was this cheat sheet helpful?
Explore Topics
#CanaryDeployment#CanaryDeploymentCheatSheet#DevOps#Advanced#CoreConcept#NginxWeightedCanary#Kubernetes#Canary#ErrorHandling#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance