The Incident: The Canary That Rejected Everything
Incident Hook
This one happened on this platform.
The first version of this chapter switched on canaries for the backend and the frontend in develop: Flagger, the Traefik provider, a success-rate threshold of 99%. Every new image would first get 10% of the traffic, then more, and a bad one would be rolled back automatically. The Canary objects said Initialized. Releases kept arriving in Git, and Flux applied every one of them.
Weeks later, a routine check of develop asks which version runs there. The answer: a build from March. Every release since had been rolled back - healthy ones included. Flagger’s events for each say the same:
Halt advancement no values found for traefik metric request-success-rate
probably frontend.develop is not receiving traffic
Rolling back frontend.develop failed checks threshold reached 5
Canary failed! Scaling down frontend.develop
Nothing was wrong with the releases. The analysis had nothing to measure:
- Prometheus did not scrape Traefik at all - the metric the analysis asked for did not exist;
- the routes Flagger split matched
Host(backend.develop.svc.cluster.local)- a name no request ever carries; - the frontend reaches the backend directly, not through Traefik - so even real users would not have passed the split;
develophas no users, and nothing generated requests.
A check with no data does not pass in Flagger; it fails. Five failed checks, and every release went back. And nothing said so: no alert, no failed pipeline - develop simply stayed on the old build, and each “release” looked applied in Git.
Result: for weeks, the environment where releases are tested ran none of them. Had the same canaries been enabled in production, every fix would have been rolled back there too - silently. And the routes that matched the internal name were public: on Hetzner, anyone sending that Host header to the load balancer would have reached every backend route, past the frontend’s list of allowed API calls.
The lab enables the canary as it is now - with traffic, metrics and an alert - and runs a healthy and a broken release through it.
Observed Symptoms
kubectl get canarysaidInitializedand laterFailed- nobody was looking at it.- The Deployment named in Git had the new image; the pods serving users (
*-primary) had the old one. - Flagger’s events: no values found … probably not receiving traffic, release after release.
- In Prometheus: no
traefik_*metric at all.
Confusion Phase
The team argues about the wrong things:
- Flux applied every commit - so how can the old version be running?
- is Flagger broken, or too strict at 99%?
- should canaries be switched off until someone has time?
Was the problem the canary - or an analysis that could never see a request, and a rejection nobody heard?
What AI Would Propose (Brave Junior)
- “Lower the threshold to 90% - or remove the metrics, then it promotes.”
- “Set
skipAnalysis: true, the releases are small anyway.” - “Delete the Canary objects; we had no problems before them.”
Why This Is Dangerous
- A check that never sees data is no check. A lower threshold changes nothing - a check with no values still fails. Removing the metrics does change something: then a release is promoted with no measurement at all - a broken one as readily as a healthy one, as long as its pods start (Flagger still halts a canary whose Deployment never becomes ready). The first question about a failing check is whether it can ever pass.
- A rejection nobody hears is a silent outage of the release process. Every fix, every security update stops arriving, and Git says it arrived.
- A route is a door. A route made “for the canary” is still a public route on the load balancer; what it exposes is what it routes to.
- Removing the canary removes the protection, not the cause. The next broken release reaches all users again - Chapter 15.
Pause and Predict: A frontend release makes three requests in ten fail. The canary sends it 10% of the traffic. Roughly what share of all requests fail while it does - and what has to be true for Flagger to notice?