Kubernetes Simulator
intermediate · ~8 min
Run it once
Not everything should run forever. A Deployment keeps its pods running and restarts them when they stop; a Job runs pods until they *succeed*, then stops — the right shape for a report, a migration, a backup.
Make a Job called daily-report that runs busybox with this command: sh -c "echo counting orders; sleep 5; echo 1,204 orders yesterday". Everything after -- in kubectl create job is the container's command.
Objectives
- Run a Job daily-report that completes
- Read what it printed
- Bonus: Write it as YAML and kubectl apply -f it (try --dry-run=client -o yaml)
Best on a computer with a keyboard. It works on a phone, with shortcuts under the terminal.