Chapter 10: Version Promotion
Learning Objectives
By the end of this chapter, you will be able to:
- Trace an image from its build to production - which environments are built, which are promoted - and prove by digest that production runs what staging tested
- Read an ImagePolicy: which tags it accepts, which one it picks, and how the picked tag reaches Git
- Tell a tag’s name, a tag that is never overwritten, and a digest apart - and say which one proves identity
- Prepare a production rollback as a Git change - and explain why, where image automation runs, it must pin the ImagePolicy and not only revert
newTag
Recall Check
Before continuing, quickly recall:
- What does Flux do with a change made by hand to a Deployment it manages? (Chapter 03)
- Which checks run on every pull request before it can merge? (Chapter 05)
- During a rolling update, what keeps the old pods serving until the new ones are Ready? (Chapter 09)
If you can’t answer these, revisit the corresponding chapter before proceeding.
Context
Chapter 09 kept enough pods running while they are replaced. This chapter is about what they are replaced with.
A release is safe only if production runs exactly what was tested. The simplest way to break that is to build again: a rebuild of the same commit pulls dependencies and base images as they are today, and produces a different image - one nobody tested. So the platform builds develop and staging from their branches, and never builds production: a tested staging image is given a production tag. The tag is new; the content - and its digest - are the same.
On the cloud cluster, Flux then does the rest. An ImagePolicy per environment watches the registry and picks the newest tag of that environment’s format; image automation writes it into the overlay in Git; Flux deploys it. Every version change is a commit you can read and revert. And that is also the trap of this chapter: a revert of that one line is not a rollback when automation writes the newest tag back five minutes later.
The chapter shows the whole path - and how to prove, at every step, which image is really running.
Work through each lesson section; the chapter video, once it is published, gives the concept overview.
From a Commit to Production
On your kind cluster the ImagePolicy and the image automation are missing: a tag changes only when you commit it - Flux still applies that commit, like any other.