Chapter 19: Progressive Delivery
Learning Objectives
By the end of this chapter, you will be able to:
- Explain what a canary limits - the share of requests a bad release gets, and for how long - and what it needs to decide: traffic, metrics, and a threshold
- Trace a release of the frontend through Flagger and Traefik, step by step, from the first 10% to the promotion or the rollback
- Show that a canary check with no data is not a pass, and why a canary that rejects everything protects nothing
- Roll a bad release back without a person, measure how many requests it failed, and see the alert that says it happened
Recall Check
Before continuing, quickly recall:
- How does a new image reach
develop, and what does a rollback of it look like? (Chapter 10) - What is the error ratio of user requests, and where does Prometheus get it from? (Chapter 11)
- In the incident of Chapter 15, how many users did the release with
RANDOM_ERROR_RATE=0.3reach, and how long until it was reverted? (Chapter 15)
If you can’t answer these, revisit the corresponding chapter before proceeding.
Context
Every release in this course so far reached all users at once. Chapter 15 showed what that costs: a configuration release made three requests in ten fail, for every user, until a person noticed, decided and reverted it. A canary changes the order: the new version gets a small share of the requests first, its own success rate and latency are measured, and only a version that passes gets more - up to all of it. A version that fails goes back without anyone deciding, while most requests never reached it.
This chapter shows one widely used way to do it, not every way: Flagger with Traefik, weighted canaries of the frontend in develop. Others work too:
- Argo Rollouts - the same idea as a replacement for the Deployment, with its own analysis resources;
- a service mesh (Istio, Linkerd) - traffic split between services inside the cluster, not only at the ingress;
- blue/green - the new version runs beside the old one, is tested, then gets all the traffic at once;
- feature flags - the new code ships switched off and is turned on for some users (Chapter 18 used one).
Only the frontend, on purpose. It is static files and a proxy, holds no data, and going back is the previous image - nothing else. A canary of the backend runs two versions against one database at once: their schema must fit both (Chapter 18), and the traffic between the frontend and the backend would have to be split inside the cluster, which takes a mesh or a gateway. That is beyond one chapter.
Work through each lesson section; the chapter video, once it is published, gives the concept overview.