Kubernetes day 2 hands-on
You upgrade a three-node control plane across two versions without a single failed request.
- Free · no subscription
- 17 days · 45–120 min each
- 140 drills · with expected output
$ cat /etc/apt/sources.list.d/kubernetes.list
$ apt-cache madison kubeadm | head -3
Expected
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.35/deb/ / kubeadm | 1.35.10-1.1 | https://pkgs.k8s.io/core:/stable:/v1.35/deb Packages kubeadm | 1.35.9-1.1 | https://pkgs.k8s.io/core:/stable:/v1.35/deb Packages kubeadm | 1.35.8-1.1 | https://pkgs.k8s.io/core:/stable:/v1.35/deb Packages
What you'll be able to do
- Describe workloads with readiness, PDB, spread and preStop so that a drain does not cost a single request
- Upgrade three control plane nodes under load from v1.35 to v1.36 without losing a single request
- Carry out a restore from an etcd snapshot when an upgrade goes wrong
- Replace a control plane node with its etcd member and patch all nodes by runbook without downtime
What you need
LabThree fresh VMs with Ubuntu 24.04, SSH access and sudo – in the lab 4 vCPU/11 GiB and twice 2 vCPU/3.8 GiB
Day 14A VM for the k3s server – it can also be one of the other machines in your lab
InternetInternet access from the VMs for packages (pkgs.k8s.io), images and tool downloads
Prior knowledgeThe book is for platform and DevOps engineers and admins who are responsible for a self-managed cluster. You should know Pods, Deployments, Services, Helm and kubectl from everyday work.
Set up your labKubernetes locally · Lab VMs
Training plan
One day = one sitting. Every day ends with a checkpoint and a challenge. About 21 hours in total.
Read first: Preface
Training days
- Day 0 The training groundA cluster of three control plane nodes on Kubernetes v1.35, a virtual API address and a test application with a load generator 90 min
- Day 1 Inventory – what is actually running here?Know every version in the cluster, apply the rules for version skew and derive an upgrade calendar from them 45 min
- Day 2 What a careless drain costsMeasure how many requests a kubectl drain without precautions costs, and understand why 45 min
- Day 3 Staying reachable – from 21 errors to 0Describe shop so that a drain does not cost a single request, and measure it 60 min
- Day 4 Find deprecated APIs before they disappearFind manifests, Helm releases and clients that use API versions which go away with the next upgrade, and migrate them 45 min
- Day 5 Upgrade plan and the way backKnow what changes before the first upgrade, and have a tested way back in your pocket 45 min
- Day 6 Upgrade to v1.36 – the control planeUpgrade all three control plane nodes from v1.35.10 to v1.36.6 under load without losing a single request to shop, and measure the API gaps 75 min
- Day 7 Upgrade to v1.36 – the kubeletsUpgrade kubelet and kubectl on all three nodes to v1.36.6, node by node, without losing a single request 45 min
- Day 8 Add-ons in the right orderUpgrade Cilium from 1.19 to 1.20 and metrics-server from 0.8 to 0.9, check compatibility beforehand, and not lose local customizations 60 min
- Day 9 v1.37 on your own – and the emergencyUpgrade the cluster to v1.37.2 using the order from Day 6, then repair an accident with the etcd snapshot, including the consequences nobody thinks of 120 min
- Day 10 Certificates, before they expireFind all certificates of the cluster, give the kubelets real serving certificates, get rid of --kubelet-insecure-tls, and renew the control plane by hand without an outage 75 min
- Day 11 Maintaining etcdRead the state of etcd, understand why the database grows and does not shrink by itself, defragment members without an outage, and create snapshots automatically 75 min
- Day 12 Replacing a control plane nodeTake a control plane node and its etcd member cleanly out of the cluster and add it back as a new node, without downtime for workloads and the API 75 min
- Day 13 Cleanup and capacityFind and remove leftovers from upgrades and rollouts, set and enforce requests and limits as the basis for capacity planning, keep the nodes' disks under control 60 min
- Day 14 Automating upgrades with k3sRaise a k3s cluster declaratively across two minor versions with the system-upgrade-controller, measure outages and tie upgrades to release channels 60 min
- Day 15 Patching the operating system by runbookBring all nodes to a new kernel, node by node with a reboot, following a written runbook and without downtime for workloads and the API 90 min
Finale
against the clock- Day 16 Competition – the maintenance nightIn five rounds, find and fix faults from everyday operations, against the clock and without a single failed request 90 min
- Appendix B Final ExamYou find and fix ten operational problems from across the book in 120 minutes, each with cause and proof, and grade yourself 120 min
Extras
optionalReady? Day 0 takes 90 min.
Reading works without an account. A free account saves your progress.
Related courses
More on this topic: Kubernetes courses