Lab & Completion

What You Will Produce

On your own kind cluster, you see what the reconcile loop gives you and what it costs. A deleted NetworkPolicy comes back at the next reconcile; a hand fix is set back to Git; a suspended Kustomization keeps the hand fix while it reports Ready, and a resume puts Git back in charge. Then flux diff shows what a change in the shared base would delete in every environment - before anything is merged. A last task, without commands, traces another object to its file on your own. Nothing is committed.

Before You Start

The baseline from Chapter 00 must be clean:

flux --context kind-sre-control-plane get kustomizations -A          # every row READY=True and SUSPENDED=False
kubectl --context kind-sre-control-plane get pods -A --no-headers | grep -vE 'Running|Completed'   # prints nothing
make smoke-test                     # Fail: 0

The Lab in Three Parts

  • A. Verify - where Flux reads from, that your working copy is that commit, that nothing is suspended, who owns the backend, and which Kustomization decrypts.
  • B. Break & Fix - a hand fix set back to Git; a suspend that hides behind Ready; resume; a deleted object comes back at the next reconcile; flux diff previews a prune.
  • C. Rollback & Cleanup - the working copy is clean, nothing is suspended, and the baseline is proven.

Open the lab →

Done When

  • git status --short printed nothing, and HEAD, the source and network-policies-develop were on the same commit (A2)
  • flux --context kind-sre-control-plane get kustomizations -A | awk 'NR==1 || $4=="True"' printed only the header before you started (A3)
  • after flux reconcile, the backend’s memory limit in develop was back to 256Mi (B2)
  • while backend-develop was suspended, the limit stayed 512Mi and the row showed SUSPENDED True and READY True (B4-B5)
  • after flux resume, the limit was 256Mi again (B6)
  • the deleted NetworkPolicy was back after the reconcile (B7)
  • flux diff printed ... allow-backend-metrics-from-observability deleted with exit=1 for develop, staging and production (B8)
  • at the end, flux diff returns exit=0, git status --short prints nothing, nothing is suspended, and the baseline is clean (C1-C2)

Knowledge Check

Before finishing this chapter, complete the Quiz.