Problem statement
The only debugging tool in use is deleting the pod and hoping; nobody reads what the process said or checks the filesystem it sees. The namespace triage has the evidence - a long-running worker, a two-container pod, and one workload that crashed three times before it finally connected.
About this exercise
Two commands turn a pod from a black box into something you can question:
- kubectl logs prints what a container wrote to standard output. Three things about it decide whether you get the right text: a pod with more than one container needs to be told which one (without it, the first container answers and the one you wanted stays silent); a container that has restarted keeps the previous instance's log available separately - that is where a crash's last words are, since the running instance's log starts empty; and the output can be limited to the last N lines instead of everything.
- kubectl exec runs a command inside a running container. It answers questions the API cannot: what files exist, what the process sees, what an environment variable really holds.
kubectl logs --help and kubectl exec --help document the flags.
The seeded workloads: ledger-worker prints two lines and stays alive; invoice-pair runs two containers, renderer and shipper, each printing its own marker, and the renderer writes a file at /work/invoice.txt; mailer-crash failed three times, each attempt announcing its number, before the fourth succeeded.
How this project is graded
The grader compares your saved answers against what the cluster and the containers actually contain. Everything here is read-only.
What you will build
Six answers in answers/, listed in answers/questions.md:
ledger.txt what ledger-worker has printed ledger-tail.txt only the last line ledger-worker printed mailer-now.txt what the mailer-crash container running now printed mailer-prev.txt what the previous mailer-crash container printed shipper.txt what the shipper container of invoice-pair printed rendered.txt the contents of /work/invoice.txt inside the renderer container
Step 1 - what the process said
Capture the worker's output, and then only its last line.
log_read_returns_the_seeded_markers and tail_limit_returns_exactly_that_many_lines should pass
Step 2 - the instance that died
Capture the current instance's log and the failed instance's log. They are different instances of the same container, and they say different things.
current_instance_log_read and previous_instance_log_read should pass
Step 3 - the right container, and inside it
Get the shipper's output out of a two-container pod, and read a file that exists only inside the renderer.
container_selector_honored_on_multi_container_pod and exec_reports_in_container_truth should pass
When every test passes
You have:
- The process's own account of what happened, not a guess from outside
- The crashed instance's last words, which vanish from view the moment it restarts
- Log reads that name their container instead of taking whatever comes first
- A way to ask questions inside a running container
You do not have yet:
- The cluster's account. When a pod never starts at all there are no logs to read - the events are the only witness, and they are the next exercise.
Verify
Click Test after every step.
