Progressive delivery and automated rollback
Let the pipeline watch the canary: raise traffic in steps, compare metrics with the stable version each time, and roll back automatically when it looks worse.
Deployment strategies: rolling, blue-green and canaryContinuous delivery vs continuous deployment
Progressive delivery and automated rollback
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Progressive delivery exposes a new version to users in steps and makes each step conditional on evidence that the new version is healthy.
- Automated analysis compares the canary's metrics, such as error rate and latency, against the stable version or a fixed threshold, and aborts the rollout if they are worse.
- Compare against the stable version running at the same time, not against last week, so that traffic spikes and outside incidents affect both sides equally.
- Small samples are noisy. Wait for enough requests at each step before judging, or a healthy canary can fail and a bad one can pass by chance.
- Tools such as Argo Rollouts and Flagger run this loop on Kubernetes, and feature flag platforms do the same for features rather than deployments.
Who is watching the canary?
The canary in the last lesson sent 10% of traffic to a new version. That only helps if someone compares its metrics to the old version and acts. In practice that someone is an engineer staring at a dashboard at 4 p.m., deciding by eye whether a wobble in the error graph is real. They get bored, they get it wrong, and they aren’t there at 3 a.m.
Progressive delivery turns that judgement into a loop the system runs itself:
- Shift a small share of traffic to the new version.
- Wait, and measure it against the stable version.
- If it’s healthy, move to the next step. If not, send all traffic back to stable and stop.
- Repeat until it serves 100%.
The term was popularised around 2018 by James Governor of RedMonk, and it covers canaries, blue-green with checks, and feature flag rollouts alike. What makes it progressive is that exposure grows only on evidence.
Building the loop
I wrote the loop in 29 lines of Python, driving the same weighted proxy and test servers as the previous lesson. The steps are 10%, 25%, 50% and 100%. At each step it writes the weights, sends 200 requests through the proxy, counts errors per version, and aborts if the canary’s error rate is more than two percentage points above the stable version’s:
for w in STEPS:
set_weight(w)
s = sample(REQUESTS)
...
base = s.get("v1", (0, 0.0))[1]
if "v2" in s and s["v2"][1] > base + MAX_EXTRA_ERRORS:
set_weight(0)
print(f"ABORT: canary error rate {s['v2'][1]:.1%} > stable {base:.1%} + {MAX_EXTRA_ERRORS:.0%}; weight set to 0")
sys.exit(1)
Against a healthy v2:
weight 10% v1: 181 req, 0.0% errors v2: 19 req, 0.0% errors
weight 25% v1: 149 req, 0.0% errors v2: 51 req, 0.0% errors
weight 50% v1: 107 req, 0.0% errors v2: 93 req, 0.0% errors
weight 100% v2: 200 req, 0.0% errors
canary promoted to 100%
exit=0
Then I started a v2 that fails 8% of its requests and ran it again:
weight 10% v1: 189 req, 0.0% errors v2: 11 req, 18.2% errors
ABORT: canary error rate 18.2% > stable 0.0% + 2%; weight set to 0
exit=1
Afterwards routes.json read {"9101": 100, "9301": 0}, and 50 more requests all got v1 200. The bad version reached about 5% of the requests in that step, and about 1% of requests overall failed, before it was pulled. Nobody had to be watching.
The sample-size trap
Look at the abort again: 2 failures out of 11 requests, reported as 18.2%. The true failure rate was 8%. With so few requests, chance swings the number wildly. It also cuts the other way. An 8% failure rate could easily show zero errors in a handful of requests and pass.
Real analysis tools handle this by measuring repeatedly over an interval, requiring several consecutive failures before aborting, setting a minimum request count, or using statistical tests. Low-traffic services are the hard case. At ten requests a minute, a 5% canary sees one request every two minutes, so steps need to last longer or the canary needs a bigger share.
What to measure
The best canary metrics are symptoms users feel:
- Error rate: 5xx responses, failed jobs.
- Latency: p95 or p99, not the average, which hides the slow tail.
- Business signals: checkout completions, sign-ups, if you can measure them per version.
Compare against the stable version at the same time. A traffic spike or a slow database affects both sides, so the difference isolates the new code. Fixed thresholds tied to your SLOs are a useful second check. Getting these metrics per version needs labels in your metrics system, covered in metrics with Prometheus.
How tools express it
On Kubernetes, Argo Rollouts (v1.10.2 was the latest release when I checked on 2026-11-27) and Flagger run this loop. In Argo Rollouts you replace a Deployment with a Rollout that lists steps, and attach an AnalysisTemplate that queries a metrics provider. This is written from the Argo Rollouts analysis documentation. I did not run it, since I have no cluster here:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: shop
spec:
strategy:
canary:
analysis:
templates:
- templateName: success-rate
startingStep: 1
steps:
- setWeight: 10
- pause: {duration: 5m}
- setWeight: 25
- pause: {duration: 5m}
- setWeight: 50
- pause: {duration: 10m}
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
metrics:
- name: success-rate
interval: 1m
failureLimit: 2
successCondition: result[0] >= 0.99
provider:
prometheus:
address: http://prometheus.monitoring:9090
query: |
sum(rate(http_requests_total{app="shop",code!~"5.."}[2m]))
/ sum(rate(http_requests_total{app="shop"}[2m]))
I parsed it with Python’s YAML library, which read back a Rollout and an AnalysisTemplate, so it is well formed. Whether a cluster accepts it, I have not tested. The template measures the success ratio every minute and fails after more than two bad measurements. The docs say that a failed analysis aborts the rollout, setting the canary weight back to zero and marking the rollout Degraded. A real query would usually filter to the canary’s pods. The Rollout’s selector and pod template are left out here for length.
The same loop works for features rather than deployments: feature flag platforms can roll a feature out to 1%, 10%, 50% of users and turn it off automatically when an attached metric degrades.
About the video
The embed is a 7½-minute clip from “Tutorial: Progressive Delivery with Argo Rollouts”, a KubeCon workshop posted by the CNCF in 2024 with speakers from Red Hat, Akuity and Codefresh. By its chapter titles, the clip covers “Progressive delivery concepts”, “Deployment strategies”, “Argo Rollouts mechanics” and “Automated analysis integration”. The hands-on workshop that follows is left out. I had no transcript, so this is from the title, description and chapters. English was judged from the same metadata. Anton Putra’s video comparing a manual canary with an automated one using Flagger, and the Argo project’s own nine-minute demo, are under deeper.
Where this fits
Automated rollback covers failures you catch during a rollout. Some only show up later, and some can’t be rolled back at all. The last lesson in this group is about that decision: rolling back and rolling forward.
Check yourself
What makes a rollout progressive delivery rather than just a canary?
Exposure grows in defined steps, and each step only happens if analysis of real metrics says the new version is healthy. Without that automated gate it is a manual canary that depends on someone watching.
Why compare the canary to the stable version rather than to a fixed error budget alone?
Both receive the same traffic at the same time, so a traffic spike, a slow dependency or a bad hour affects both. The difference between them isolates the effect of the new version.
At the 10% step the canary served 11 requests and 2 failed, so its error rate is 18%. Is the canary definitely bad?
Not definitely. Two errors out of eleven is weak evidence and could be chance. Good analysis waits for a minimum number of requests, or uses several measurements, before deciding. Here the stable version had no errors at all, so aborting was still the cautious choice.
Which signals make good canary metrics?
Symptoms users feel, such as error rate and latency, compared with the stable version. Many teams add business signals like checkout completion. CPU and memory are useful context but rarely decide whether users are hurt.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.