Lab
A kubectl terminal on kx, a simulated kind cluster running Kubernetes 1.37, beside a live map of what it holds. Pick a starting point, type commands, break things; a reset puts the cluster back.
A fresh kind cluster with nothing of yours on it.
Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.
Break the cluster
- None of your running pods has an owner to replace it.
- Runs docker stop kx-worker. The node goes Unknown 50 s after its last heartbeat; its pods are evicted 300 s after that.
- None of your running pods has a memory limit.
- Runs kubectl -n kube-system delete pod -l k8s-app=kube-dns. Lookups time out until the CoreDNS ReplicaSet's new pods are ready.
- Runs kubectl scale deployment/coredns -n kube-system --replicas=0. Nothing scales it back: lookups time out until someone does.
- Runs kubectl drain kx-worker --ignore-daemonsets --delete-emptydir-data. The node is cordoned and its pods evicted; their controllers start them elsewhere.
Each button runs its command on the cluster. This line follows what happens next.
Cluster kx
Arrow keys move between nodes and pods. Enter opens what you can do with one.
No Deployments yet. Pods you create land on the nodes below.
- CPU950m/4Mem290Mi/8Gi
- CPU200m/4Mem250Mi/8Gi
- CPU100m/4Mem50Mi/8Gi
- CPU100m/4Mem50Mi/8Gi
Waiting for a node
- No pods waiting.
Guided labs
36 labs, about 7 hours in all, in the order of the lessons they practise. Each one starts its own cluster and checks every step against it as you work: a step stays dashed until the cluster shows it done, then turns solid. A finished lab turns solid here too.
The API and the loop
6 labs
Who does what in the control plane, not completed
Find kx's control-plane components, read a node's heartbeat, then cordon and drain a worker and watch the scheduler and controllers move a workload around it.
- 12 min
- 6 steps
Lesson
Read the API's bookkeeping, not completed
Use discovery to find group versions, watch generation and resourceVersion respond to different kinds of write, and release an object held by a finalizer.
- 12 min
- 6 steps
Point kubectl at a namespace and preview a change, not completed
Set a default namespace on your context, pull exact fields out of objects, scaffold a manifest with a generator, and use a server dry run and a diff before and after you apply it.
- 14 min
- 7 steps
Lesson
Select, filter and scope, not completed
Read labels, write a set-based selector, clean up with a field selector, repair a namespace selector that matches nothing, and retire a canary by label.
- 12 min
- 5 steps
Apply, drift and three patch types, not completed
Create a Deployment declaratively, drift it by hand, preview and undo the drift with apply, patch it three ways, and watch the three-way merge decide which changes survive.
- 12 min
- 7 steps
Orphans, adoption and a stuck namespace, not completed
Trace who owns the pods of a Deployment, replace the Deployment without restarting a single pod, then find and release the finalizer that holds a namespace in Terminating.
- 12 min
- 6 steps
Pods and workloads
7 labs
Take apart a two-container pod, not completed
Create a pod with an nginx container and a helper, inspect each container on its own, then watch a bare pod disappear for good and hand the job to a Deployment.
- 10 min
- 6 steps
Lesson
Read the signals of two failing pods, not completed
Two pods restart in a loop for different reasons. Tell phase from status, read the previous run's logs and the last exit code, then replace the pod you can fix.
- 12 min
- 6 steps
Unblock an init sequence and finish a Job, not completed
A pod waits on an init container for a dependency that does not exist. Find it, supply it, confirm the sidecar keeps running, then see why only one of two Jobs ever completes.
- 12 min
- 6 steps
Give a slow starter its startup budget, not completed
A Deployment never becomes available because its liveness probe kills the app before it finishes starting. Read the evidence, measure the startup time, and fix it with a startup probe instead of a weaker liveness probe.
- 12 min
- 5 steps
Roll out, stall and undo, not completed
Tune a Deployment to keep full capacity, ship a release with a change cause, scale without a new revision, then watch a typo stall a rollout and undo it.
- 14 min
- 7 steps
Run a node agent everywhere, not completed
Find the node a DaemonSet skips, tolerate its taint, then roll a new image out by hand with OnDelete and automatically with RollingUpdate.
- 12 min
- 6 steps
Lesson
Run, shard, retry and schedule batch work, not completed
Run a one-off Job, fan an Indexed Job out wider, watch backoffLimit stop a failing migration, and drive a CronJob by hand.
- 14 min
- 7 steps
Lesson
Scheduling and nodes
7 labs
Quota, defaults and a stalled scale-up, not completed
Find why a Deployment in a quota-bound namespace creates no pods, fix it with a LimitRange, then read and clear a quota ceiling.
- 12 min
- 5 steps
Who the kubelet evicts, and why, not completed
Read QoS classes, trace a node-pressure eviction from the pod to the node, and contain the workload that caused it with a memory limit.
- 12 min
- 5 steps
Read the scheduler's verdicts, not completed
Decode a FailedScheduling message node by node, clear the leftover cordon behind it, and release a pod held by a scheduling gate.
- 12 min
- 6 steps
Dedicated nodes and a NoExecute retirement, not completed
Get batch pods onto a tainted, labeled node pool, then retire a worker with a NoExecute taint and watch the eviction.
- 12 min
- 5 steps
Make room for checkout, not completed
A batch job fills every worker and the checkout service sits Pending. Give checkout a PriorityClass, watch the scheduler preempt a batch pod, and read what it left behind.
- 12 min
- 6 steps
Lesson
Take a node out of service, not completed
Read a Node object, cordon it, and drain it past the three kinds of pod that kubectl drain refuses by default.
- 12 min
- 6 steps
Lesson
Unblock a drain without dropping the budget, not completed
A PodDisruptionBudget that demands every replica stops any node drain. Read why, rewrite it to allow one disruption, and drain the node.
- 12 min
- 6 steps
Networking
5 labs
Trace the pod network, not completed
Find the network plugin, read each node's pod range, reach a pod on another node by its IP, and see where Service addresses come from.
- 10 min
- 5 steps
Lesson
Wire a Service's ports, not completed
Fix a Service that sends traffic to the wrong port, add a second port, then expose the same pods as a NodePort and as a headless Service.
- 13 min
- 6 steps
Lesson
Read EndpointSlices and their conditions, not completed
Find a pod that a Service skips, wire a Service with no selector to an outside address, and watch an endpoint terminate.
- 12 min
- 6 steps
Resolve names through cluster DNS, not completed
Read a pod's resolver settings, resolve Services across namespaces and pods behind a headless Service, find CoreDNS's upstream, and cut the search-list walk.
- 12 min
- 6 steps
Lesson
Lock down a namespace with NetworkPolicies, not completed
Isolate every pod in shop, restore DNS, then open exactly the paths the frontend and one debug pod need.
- 12 min
- 6 steps
Lesson
Config, storage and state
4 labs
Wire a ConfigMap and roll it safely, not completed
Unstick a Deployment waiting on its ConfigMap, then ship a configuration change as an immutable, versioned ConfigMap and a rollout.
- 12 min
- 6 steps
Lesson
Mount a Secret, audit who can read it, rotate it, not completed
Give a Deployment the Secret it mounts, find the RBAC path that reads it without any rule on secrets, and rotate the value in place.
- 12 min
- 7 steps
Bind two stuck claims and keep a volume after its claim, not completed
Read why two PersistentVolumeClaims in
mediaare Pending, give each what it waits for, then switch a volume to Retain and watch it outlive its claim.- 12 min
- 7 steps
Name, stage and shrink a StatefulSet, not completed
Give the
kvStatefulSet the headless Service its pod DNS names need, follow a claim across a pod replacement, stage an upgrade with a partition, and make scale-down delete claims.- 14 min
- 6 steps
Lesson
Security
3 labs
Give each workload its own identity, not completed
Repair a Deployment that names a missing ServiceAccount, read the token the kubelet projects, and take API credentials away from pods that never call the API.
- 12 min
- 6 steps
Grant least privilege with Roles and bindings, not completed
Read a forbidden error, grant a workload exactly one resource, give a support identity in another namespace read access, and move a binding to a different role.
- 14 min
- 5 steps
Lesson
Run workloads under the restricted level, not completed
Read a PodSecurity rejection, harden a Deployment until restricted admits it, fix a container the kubelet refuses to start, and give a node agent a namespace of its own.
- 14 min
- 5 steps
Operate and ship
4 labs
Read the signals the cluster already keeps, not completed
A web tier is serving traffic and a cache keeps restarting. Use resource metrics, container logs and events, the signals every cluster has without a monitoring stack, to find out what each workload is doing and why the cache dies.
- 12 min
- 6 steps
Autoscale on CPU and fix an unknown target, not completed
web runs one replica under steady load and api already has an HPA that reports <unknown>. Put web under an HPA, predict and watch where it settles, find why api's HPA cannot compute anything, fix it, and slow down web's scale-down.
- 12 min
- 5 steps
Triage the shop namespace, not completed
Two reports arrive at once: the cart never came up after a deploy, and storefront refuses connections from inside the cluster. Work each from symptom to cause with the fixed order of commands, change one thing at a time, and verify each fix.
- 14 min
- 6 steps
Lesson
Three ways in with kubectl debug, not completed
payments runs a distroless image with no shell, invoicer crashes on start, and you need to look at a node. Attach an ephemeral container, debug a copy of the crashing pod, open a node debugging pod, and clean up after all three.
- 12 min
- 6 steps