Skip to content
Hands-on course · 16 days

System design on Kubernetes hands-on

You move a URL shortener onto a Kubernetes cluster, give every pattern its Kubernetes form and back every decision with a measurement.

  • Free · no subscription
  • 16 days · 75–120 min each
  • 132 drills · with expected output

Companion code on GitHub · PDF and EPUB · edition 2026

Day 2 · Exercise: Speed drills
# on s1
# Who set limits.cpu? managedFields keeps track of every writer
$ kubectl -n kurz get deploy kurz --show-managed-fields -o yaml \
$   | grep -B2 -A12 'manager: kubectl-set' | grep -E 'manager|f:cpu|operation'

Expected

                    f:cpu: {}
    manager: kubectl-set
    operation: Update

What you'll be able to do

  • Run a service with a database operator (CloudNativePG), a cache cluster (Valkey) and a queue (NATS JetStream with NACK) on Kubernetes and fail every component under load
  • Scale with HPA and KEDA on CPU, backlog and schedule – and find the bottleneck when more pods stop helping
  • Set rate limits, circuit breakers, retries and timeouts in the gateway (Envoy Gateway) and the mesh (Linkerd) and measure what they cost
  • Spread across zones, drain nodes and survive a zone failure, then measure capacity with zone headroom and write a design document

What you need

LabThree VMs with Ubuntu 24.04, SSH access and sudo on a shared network – in the lab 4 vCPU/11 GiB and twice 2 vCPU/3.8 GiB, one zone each

BackgroundThe predecessor course “System design hands-on” or equivalent experience; kubectl basics

InternetInternet access from the VMs for packages, Helm charts, images and downloads from the official release pages

Prior knowledgeThe course builds on “System design hands-on” and is for platform and DevOps engineers, developers and anyone who wants to practise system design on Kubernetes. You should know Linux in the terminal, SSH and kubectl basics.

Set up your labKubernetes locally · Lab VMs

Training plan

One day = one sitting. Every day ends with a checkpoint and a challenge. About 28 hours in total.

Training days

  1. Day 0 The ground – from the legacy system to k3sTear down the three VMs of the predecessor course, build a k3s cluster with three zones from them, set up a registry and build kurz and zaehler as container images 75 min
  2. Day 1 kurz as a DeploymentRun PostgreSQL with CloudNativePG as a single instance, restore the 2.7 million old links and start kurz as a Deployment with Service, ConfigMap, Secret and probes 75 min
  3. Day 2 Measuring in the clusterPut kurz under load in the cluster, find the bottleneck with Little's Law, set requests and limits, make CPU throttling visible and compare the numbers with those from the VMs 90 min
  4. Day 3 Gateway API with Envoy GatewayInstall Envoy Gateway alongside the Gateway API CRDs from k3s, make kurz reachable from outside through a Gateway, measure the price of the extra hop, place the proxies deliberately, and try out load balancing and a canary release 90 min
  5. Day 4 FailuresUnder load, crash a Pod, roll out again and cut a whole node off the network, counting the errors each time, and use preStop, retries and passive health checks in the Gateway to make sure users (almost) notice nothing 90 min
  6. Day 5 Cache with Valkey via an operatorRun a Valkey cluster with three shards via an operator, connect kurz to it, measure the hit rate and database load, fail a primary under load and see what a wrongly sized cache does 90 min
  7. Day 6 PostgreSQL with replicasGrow the CloudNativePG cluster to three instances, let kurz read from the read Service, create replication lag and see what it means for “reading what you just wrote”, let a replica fail and measure the price of synchronous replication 90 min
  8. Day 7 Failover and poolerSwitch the primary in a planned and an unplanned way while load is running, find a bug in the connection pool of kurz and fix it with a single parameter, set up PgBouncer as CNPG's pooler and measure what it brings during a failover and what it does not 100 min
  9. Day 8 Asynchronous with NATS JetStreamRun NATS as a JetStream cluster across three zones, create the stream KLICKS declaratively with NACK, start zaehler as a Deployment and measure what synchronous and asynchronous counting cost – then let NATS fail under load and count again what gets lost 100 min
  10. Day 9 Scaling with the HPAScale kurz by CPU with the Horizontal Pod Autoscaler (HPA), measure when more Pods really help and when they hurt, determine the reaction time to a load spike, and trigger the most common trap of switching to the HPA once under load 100 min
  11. Day 10 Scaling by queue length with KEDAScale zaehler by the backlog in the stream instead of by CPU, down to zero Pods and back up, measure where more workers stop helping, find and fix the bottleneck behind it, and pre-warm kurz on a schedule 110 min
  12. Day 11 Rate limiting and backpressure in the GatewayCatch overload at the entrance instead of in the backend: a local limit per Envoy, a global limit per user with its own counter store, and a circuit breaker that rejects early instead of keeping clients waiting – measured with k6 each time, including where the protection brings less than hoped 100 min
  13. Day 12 Linkerd – retries, timeouts, mTLSBring kurz into the service mesh, measure what the proxy costs, prove mTLS between pods, and then smuggle in two broken copies of kurz – one that only returns errors and one that takes two seconds. How do the mesh and the gateway deal with them? 110 min
  14. Day 13 Zones – topology spread, PDBs, losing a zoneSpread kurz evenly across three zones, drain a node under load and see what gets stuck, and then switch off a whole zone – the one with the database primary. At the end there is a change to kurz that cuts the damage of a zone outage by two thirds 120 min
  15. Day 14 Capacity and the design documentMeasure what the whole stack from 13 days carries, where the CPU goes and how much of it remains when a zone fails – and write everything you have measured into a design document that another team can read and review 120 min

More