Skip to main content
RunBook Academy

LinuxXXXIII · Fleet Patch ManagementCanary waves

Canary and wave deployments - phased rollout with health checks

Intermediate⏱ ~10 minload-balancermonitoring

What you'll learn

  • Design a canary deployment
  • Choose canary size and hold time
  • Validate canary health before expanding
  • Roll back on canary regression

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

A canary deployment exposes a small subset of users to the new version. If health is good, expand. If regression, rollback. This is the safest pattern for production changes.

Canary pattern

1. Deploy new version to 5% of hosts
2. Send 5% of traffic to new version
3. Monitor health for 30 minutes
4. If good: deploy to 25%, 50%, 100%
5. If bad: rollback immediately

Choose canary size

The canary should be:

  • Big enough to surface issues (5-10% of production).
  • Small enough to limit blast radius.
  • Representative of the full fleet (similar load).

For a 100-host fleet: 5 hosts canary. For a 1000-host fleet: 50 hosts canary.

Hold time

After deploying to the canary, hold for:

  • 15 minutes: small changes, well-tested.
  • 30-60 minutes: typical patches.
  • 4-24 hours: major upgrades.

The hold time should be longer than the typical intermittent failure window (cron runs, log rotation, etc.).

Health checks

Monitor the canary for:

  • Error rate (HTTP 5xx, application errors).
  • Latency (p99, p95, p50).
  • Resource usage (CPU, memory, network).
  • Synthetic monitoring (transactions per second).
  • Custom business metrics (logins, conversions).

If any metric degrades significantly, rollback.

Rollback

Rollback should be fast and automatic when possible:

# Ansible rollback
ansible-playbook -i prod rollback.yml --limit canary_group

# Container redeploy
kubectl rollout undo deployment/myapp

The canary exists to give you a fast, safe rollback path.

Blue-green vs canary

  • Blue-green: two identical environments; switch traffic all at once.
  • Canary: gradual rollout; traffic shifts over time.

Canary is safer for stateful services. Blue-green is faster for stateless services.

Knowledge check

Knowledge check · 3 questions

  1. Q1. What is the typical canary size?

  2. Q2. Canary deployments should be applied to all hosts at once.

  3. Q3. Which of the following are valid canary hold times? Select all that apply.

Passing score: 75%. Answers are checked in this browser.