Payments service, mission 1 of 4
Migrate, then release
intermediate, about 10 minutes, in the Kubernetes Simulator
Free in your browser, nothing to install.
The briefing
payments 2.0 is ready to ship, but it reads a refunds table that only exists once database migration 0042 has run. migrate.yaml is a Job that runs it.
Run the migration, wait for it to complete, and only then roll payments to ghcr.io/hackademy/payments:2.0. kubectl wait --for=condition=complete job/NAME blocks until a Job has finished, so nothing after it starts early.
What you'll do
- Migration 0042 completed
- payments: 2 ready replicas on 2.0
- No 2.0 pod started before the migration finished
- Bonus star: Wait with kubectl wait, not by watching
The mission checks the cluster, not your keystrokes: any fix that works, passes.
Concepts
kubectl wait
Blocks until an object meets a condition, then returns:
Read the Kubernetes docs--for=condition=completefor a Job,condition=availablefor a Deployment,condition=readyfor pods.--timeoutbounds the wait (30s by default) and makes it fail loudly. Scripts and release pipelines use it so one step never starts before the last one finished.
More Payments service missions
- 1. Migrate, then release
- 2. Not dead, just slow
- 3. No shell
- 4. Charged twice