Problem statement
Three releases are queued for the web tier, and the team has agreed to stop improvising. Namespace release-train runs web-tier on four replicas of v1, inherited with no headroom during a release and the stock progress deadline, which means every release so far has been slow, silent and undocumented. Ship v2, v3 and v4 the way a release train is meant to run - and when v4 turns out to be a dud, prove the system catches it and reverses cleanly.
About this exercise
This brings together the topic's three exercises:
- Rolling - a new template replacing the old one progressively, inside the surge and unavailable bounds you declare (Rolling Updates)
- Recording - revisions, the change cause on each, and returning to one of them (History & Rollback)
- Control - batching edits under a pause, and a progress deadline that turns a stuck release into a reported failure (Pause, Resume & Failed Rollouts)
One idea ties them together: a release is an event that must leave a record. Every phase of the train produces something the next engineer can read without asking anyone - a revision with a cause, a ReplicaSet that shows what ran, a verdict when a release does not finish. Some of that record the cluster keeps for you. The rest is transient: a rollout's intermediate counts, and a failure's condition, exist for seconds and are gone the moment you recover. Those you capture while they are true.
The last phase is where the discipline pays. A release that can never become ready must not be allowed to take the previous one down with it, and must not be allowed to hang indefinitely either. The bounds keep the old replicas serving; the deadline produces the verdict; the history makes the way back a single named revision rather than an archaeology exercise.
How this project is graded
The grader reads the live Deployment, every ReplicaSet it owns, the revision number and change cause on each, and the audit files you saved at each phase. The ReplicaSet stack is the timeline: a release that rolled twice, or a rollback that retyped a template instead of returning to one, shows up in it whatever the files say. The files carry what the cluster no longer holds. The namespace is re-seeded only when the Deployment is missing, so the train you build stays built.
What you will build
Everything lives in namespace release-train, deployment web-tier, container web.
The train's standing configuration - set before the first release and kept for all of it:
strategy type RollingUpdate maxSurge 1 maxUnavailable 1 progressDeadlineSeconds 30 replicas 4 unchanged minReadySeconds 4 unchanged
Release v2 - image alpine:3.20, change cause v2 promote alpine base. While it rolls, sample the Deployment's replica and available counts; once it is done, record what the namespace's ReplicaSets look like.
answers/v2-observed.txt one line per sample taken WHILE v2 is rolling:
"<replicas> <available>" - the Deployment's total replica
count and its available replica count, space separated.
At least four samples, at least one taken while the surge
replica existed.
answers/v2-audit.txt the ReplicaSet listing for the namespace, including the
image each one runs, taken once v2 has finished
Release v3 - two changes, one rollout. With the Deployment not acting on edits, set image nginx:alpine and env RELEASE=v3, and give it the change cause v3 batch image and marker. No ReplicaSet may exist in this namespace carrying only one of the two changes.
answers/v3-paused.txt the ReplicaSet listing with images, taken after both edits
were made and before the Deployment was allowed to act
answers/v3-revision.txt the detail of the revision v3 landed as - its whole pod
template
Release v4 - image nginx:1.99-does-not-exist, change cause v4 promote broken build. It will never become ready. Let it run out of its deadline, and while it is failing record:
answers/v4-verdict.txt the failure the cluster recorded on web-tier, naming
the reason it gives
answers/v4-pull-reason.txt the reason on the waiting container of a pod from the
broken release, exactly that word and nothing else
answers/v4-serving.txt how many replicas were still available while that
rollout was failing, exactly that number
The reversal - return web-tier to the revision v3 landed as, so all 4 replicas serve nginx:alpine with RELEASE=v3 again. Do not record a new change cause for it: the revision the rollback brings back carries v3's own.
The audit - answers/history.txt, the revision listing once the train is done. Four revisions survive in it, because the rollback re-used and re-stamped the ReplicaSet that v3 landed on, so v3's original number is no longer in the list:
1 initial rollout 2 v2 promote alpine base 4 v4 promote broken build 5 v3 batch image and marker
The tests
- Rolling_release_train_declares_its_bounds_and_deadline - the standing configuration is in place, not the inherited one
- Rolling_v2_replaced_pods_within_the_surge_and_unavailable_bounds - the sampled counts never leave the window the bounds define
- Rolling_v2_audit_shows_the_new_replicaset_fully_scaled - v2's ReplicaSet took all four replicas, the old one kept at zero
- Batching_v3_paused_edits_deferred_the_rollout - both edits were in and nothing had rolled
- Batching_v3_landed_as_one_revision_with_both_changes - one revision carries both, and its template is on record
- Failure_v4_declared_failed_by_the_progress_deadline - the cluster reported the stuck release instead of waiting
- Failure_v4_pods_reported_the_image_pull_failure - the pods say why, and not one of them became ready
- Failure_v3_replicas_kept_serving_through_the_failure - the bounds held capacity up while v4 failed
- History_every_release_recorded_with_its_change_cause - each ReplicaSet says what its release was for
- History_audit_listing_matches_the_finished_train - the saved listing is the train, with v3's number re-stamped
- Composition_rollback_restored_v3_as_the_serving_release - the exact template is back, served by the ReplicaSet that already held it
- Composition_replicaset_timeline_matches_the_release_order - four ReplicaSets, four revisions, in the order the train ran them
When every test passes
You have:
- A release train whose disruption during a release is a number you chose, not a default
- Two edits shipped as one rollout, with one revision and one entry in the history to show for it
- A broken release that announced itself in thirty seconds instead of sitting there for ten minutes
- Evidence that the previous version served every second the broken one was failing
- A reversal that is a named revision returning, and a history that reads as the train it was
- The next topic unlocked
Verify
Click Test.
