Welcome to the Drills
You run Kubernetes clusters and want to show that you can secure
them: lock down the network, harden the control plane and nodes, confine
workloads, verify the supply chain and detect attacks at runtime. That
is exactly what the CKS tests. Not as multiple choice, but in the
terminal, via ssh on real nodes, against the clock.
This book assumes CKA knowledge – just like the real exam. You should
be able to operate a kubeadm cluster, read static Pod manifests, create
RBAC objects and find faults with kubectl,
crictl and systemctl. Everything else you
learn here.
How the book works
- One day, one topic. Each day has a goal, a short briefing with the curriculum domain and 5–8 drills. You type every command yourself and compare with “Expected”.
- Insecure first, then secure. Every hardening step starts by proving the gap and ends by proving that it is closed.
- Imperative first. You generate YAML with
k create … $do > datei.yamlinstead of typing it by hand. Before every change to the control plane you back up the manifest outside of/etc/kubernetes/manifests. - Speed Drills at the end of each day: small exam tasks with a target time.
- Checkpoint, Challenge, Exam Tip, Enterprise Note close out every day.
- One application through many days: notes-api, a
small Go API. You build it as a minimal image, scan and sign it, lock it
into
restrictednamespaces, into the gVisor sandbox and behind a read-only file system. - Competition (Day 19): a deliberately insecure cluster that you secure under time pressure – all curriculum domains mixed.
- Appendix A is the cheat sheet, Appendix B a practice exam: two hours, about 16 tasks, weighted by the curriculum.
What you need
- Three VMs with Ubuntu 24.04 on the same network, with SSH access and
sudo: one for the control plane (4 vCPU, 12 GB RAM) and two workers (2 vCPU, 4 GB each). Proxmox, VMware, Multipass or a cloud – it does not matter. On a Mac with Apple Silicon the VM is ARM64 – that is why the commands detect the architecture themselves withdpkg --print-architecture. File names and output then showarm64where the book showsamd64. - About 23 hours for Days 0 to 18, plus the Competition and the practice exam. At roughly one hour per day, that is four weeks.
On Day 0 you use them to build a cluster with kubeadm running Kubernetes v1.37.1 – deliberately one patch version too old, because on Day 6 you upgrade it to v1.37.2 without losing your hardening. Cilium serves as the CNI: it supports NetworkPolicies, its own CiliumNetworkPolicies and Pod-to-Pod encryption with WireGuard. On top come Traefik as the ingress controller, a StorageClass, metrics-server and your own registry. The security tools (kube-bench, Trivy, cosign, Falco, Tetragon, gVisor and others) are installed by the day that needs them – with a checksum.
In this book the VMs have the addresses 172.16.0.126
(cp1), 172.16.0.228 (worker1) and 172.16.0.83
(worker2) – use your own.
The companion repo
The source code of notes-api and all files for the book live at
https://github.com/thomaszachmann/cks-zum-anfassen. You
clone it onto cp1 as soon as you build the image for the
first time. You still type the manifests and policies in the book
yourself – that is the training.
The exam in brief
| Domain (CKS curriculum v1.37) | Weight | Days |
|---|---|---|
| Cluster Setup | 15 % | 2, 3, 4 |
| Cluster Hardening | 15 % | 5, 6 |
| System Hardening | 10 % | 7, 8 |
| Minimize Microservice Vulnerabilities | 20 % | 9, 10, 11, 12 |
| Supply Chain Security | 20 % | 13, 14 |
| Monitoring, Logging and Runtime Security | 20 % | 15, 16, 17, 18 |
Days 0 and 1 prepare the training ground and your craft, Day 19 mixes all domains.
As things stand, the exam takes two hours, runs online and proctored
and consists of practical tasks on real clusters. Only candidates who
have already passed the CKA are admitted. Format, passing score,
validity of the CKA as a prerequisite and the permitted documentation
pages change occasionally – the authoritative source is the information
from the Linux Foundation at
https://training.linuxfoundation.org. You can find the
curriculum at https://github.com/cncf/curriculum; this book
follows the version for Kubernetes 1.37.
This book shows attacks only as far as you need them to prove a hardening step. If you want to dig deeper into how attackers take over clusters, you will find that in the book “Kubernetes attack and defense hands-on”.
Note: This book is an independent practice book. It is not affiliated with the Linux Foundation or the Cloud Native Computing Foundation and is neither reviewed nor endorsed by them. “Certified Kubernetes Security Specialist” and “CKS” are trademarks of the Linux Foundation.
Versions
Kubernetes v1.37.1 (v1.37.2 from Day 6), containerd v2.4.2, runc
v1.5.3, Cilium 1.20.5, Helm v4.3.2, Traefik v3.7.19 (chart 42.4.1),
cilium CLI v0.20.3, metrics-server v0.9.1, local-path-provisioner
v0.0.37, registry 3.1.2, podman 4.9.3, Go 1.27. Tools: kube-bench
0.16.0, etcdctl 3.7.0, gVisor release-20261116.0, Trivy 0.76.2, bom
0.8.0, cosign 3.1.4, kubesec 2.15.0, KubeLinter 0.8.3, Falco 0.45.2
(chart 9.2.2), Tetragon 1.8.0. All output comes from real runs,
shortened where it makes sense. Values such as the API key
lab-key-123 or the cosign password
lab-cosign-pw are lab values only.
Enjoy your drills.