Core Track Guardrails-first chapter in core learning path.

Estimated Time

  • Reading: 30 min
  • Lab: 35 min
  • Quiz: 5 min

Prerequisites

What You Will Produce

On your own kind cluster: proof by digest that production runs the very image staging tested - the same digest in the registry, in the running pods, and a production that reports the staging build it came from; the ImagePolicy that picks production’s tag, and the same policy pinned to the previous release; and a rollback prepared as a Git change - checked by the hooks and previewed with flux diff - with no hand change to the cluster. The lab ends with lab empty, your working copy clean and every Kustomization Ready and none suspended.

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

Diagram: push to develop build → develop-v…; develop; merge to main build → staging-v…; staging tested; promote-production re-tag → production-v… same digest, no build; ImagePolicy newest production tag; image automation commits newTag to Git; Flux applies rolling update

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.


Detailed Lessons

Hands-On Materials

Labs, quizzes and runbooks for this chapter are free - sign in with your email, Google or GitHub to open them.

  • Lab: Promote, Never Rebuild Free · sign in
  • Quiz: Chapter 10 (Version Promotion) Free · sign in