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 diffpreviews a prune. - C. Rollback & Cleanup - the working copy is clean, nothing is suspended, and the baseline is proven.
Done When
-
git status --shortprinted nothing, andHEAD, the source andnetwork-policies-developwere 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 indevelopwas back to256Mi(B2) - while
backend-developwas suspended, the limit stayed512Miand the row showedSUSPENDED TrueandREADY True(B4-B5) - after
flux resume, the limit was256Miagain (B6) - the deleted NetworkPolicy was back after the reconcile (B7)
-
flux diffprinted... allow-backend-metrics-from-observability deletedwithexit=1fordevelop,stagingandproduction(B8) - at the end,
flux diffreturnsexit=0,git status --shortprints nothing, nothing is suspended, and the baseline is clean (C1-C2)
Knowledge Check
Before finishing this chapter, complete the Quiz.