Advanced Track Do this after finishing Chapters 01-15.

Estimated Time

  • Reading: 25 min
  • Lab: 55 min
  • Quiz: 5 min

Prerequisites

  • Core track (Chapters 01-15) completed.
  • GitOps promotion and observability workflows available.

What You Will Produce

On your own kind cluster: Traefik’s request metrics in Prometheus and a canary of the frontend enabled through a pull request; a healthy release that reaches 10%, 20% … 50% of the requests and is promoted on its own measurements; a release that fails three requests in ten, rolled back automatically at a small share of the traffic while the requests the stable version serves get only 200s; the alert that says a release was rejected; and the canary switched off again, with the plain rollout back.

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.3 reach, 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.

A Release as a Canary

Diagram: Git new frontend release; Flagger starts the canary; Traefik 10% canary 90% stable; Prometheus canary's own requests OK?; yes; +10% ... up to 50%; promoted: new version serves everyone; 3 failed checks; rolled back: canary 0% alert fires

Detailed Lessons

Hands-On Materials

Labs, quizzes and runbooks of the advanced track - sign in and redeem an access code.

  • Lab: A Release That Reaches a Few First Advanced
  • Quiz: Chapter 19 (Progressive Delivery) Advanced
  • Runbook: A Canary Release Advanced