kubestronaut-sim/cka/lessons.py
vumas3r 0e5f7686ee feat: add guided lessons; move CKA and CKS to v1.37 on Ubuntu hosts
Add lessons: untimed guided labs, one per curriculum objective, on a
host of their own, in the browser and in the terminal. Each step has
a check, a hint and its commands; a lesson writes no history or
scores, only a done mark on its objective. CKAD 2.1-2.4 (24 steps)
and all 27 CKA objectives (135 steps) have one, and `./ksim lesson
audit` proves that every step fails, is done by its own commands,
then passes.

Add CKA tasks 132-147 (cka/bank_course.py) on what a full CKA course
teaches beyond the bank: a real upgrade from v1.36, a drain under a
PodDisruptionBudget, QoS and eviction, in-place resize, kube-proxy's
chains, encryption at rest, an operator, and CSI expansion, snapshots
and clones (ensure_csi_hostpath).

Move CKA and CKS to Kubernetes v1.37 and rebuild the hosts on Ubuntu
24.04, with kubelet, kubeadm and kubectl as held packages from
pkgs.k8s.io; the desktop runs Ubuntu too. Hosts gain man pages,
hexdump and xxd.

Fix CKS Q4, which gave 3 of 12 points untouched, and CKA Q4 and Q49,
whose solutions raced their new CRD.

Audited on v1.37: CKA 147/147, CKAD 105/105, CKS 109/110 (Q103, a
Falco task, failed to seed once and awaits a re-audit); lessons: 135
of 135 CKA steps and 24 of 24 CKAD steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:15:17 -06:00

28 lines
1.9 KiB
Python

"""CKA lessons: guided labs, one per curriculum objective, on a cluster of your own and without a
clock. A lesson explains, then walks you through steps that you do on its host; each step has a
check, a hint and the commands that do it. It ends by sending you to the objective's timed drill.
Lessons write nothing to the history or the scores - only a "lesson done" mark on the objective.
./ksim lesson the lessons of this track, and which you have done
./ksim lesson 1.1 start the lesson of objective 1.1 (id or key)
./ksim lesson check check the step you are on; the next one follows
./ksim lesson audit [OBJ..] prove lessons: every step fails before its commands and passes after
A lesson's host is named after its id - lesson 9101 runs on `cka9101` - which never clashes with a
task's. Its files go under {WS}/lesson-<objective>/. A step's `show` commands are what the learner
types; the audit runs exactly them, as `candidate` on the host, so what a lesson shows always
works. Work on another node is shown as `ssh NODE sudo bash <<'EOF' ... EOF`: the same commands
you would type after `ssh NODE` and `sudo -i`, in a form that runs unattended. A single command
there is `ssh -n NODE 'COMMAND'`: without -n, ssh would read the rest of the commands as its input.
One file per domain, as with the task banks. Besides the curriculum's competencies, the lessons
cover what a full CKA course teaches under each of them (2026-10-19: the topics of KubeDojo's CKA
course, written here from scratch): projected volumes, eviction thresholds, debug containers,
kube-proxy's rules, encryption at rest, in-place resize, PodDisruptionBudgets, QoS classes,
ServiceAccount tokens, a real kubeadm upgrade, EndpointSlices.
"""
from cka import lessons_arch, lessons_net, lessons_storage, lessons_tshoot, lessons_work
LESSONS = (lessons_storage.LESSONS + lessons_tshoot.LESSONS + lessons_work.LESSONS
+ lessons_arch.LESSONS + lessons_net.LESSONS)