Course

Kubernetes 101

The hands-on half of the Kubernetes book, as a self-paced course. 55 labs in 15 modules on a real Kubernetes cluster, with automatic progress verification. Open and free.

Kubernetes 101 (cover image)

About This Course

This course is the hands-on half of Kubernetes 101, a book that builds a whole tienda on Kubernetes, piece by piece (the resource names are shared between the book and the labs and stay in Spanish: "tienda" means "shop"). It is 55 labs spread across 15 modules, seven of them challenges. The last one closes the course: the final challenge. Each module is the lab for its chapter, and they follow the same path as the table of contents.

You don't need the book to do the course. It is open and free, the lessons explain themselves, and if you came here looking to practice Kubernetes, you are in the right place.

What you'll find in the book and not here is what doesn't fit in a terminal: the 54 diagrams (the life of a request inside the kube-apiserver is not something kubectl shows you), the appendix "When each piece became available", which tells you in which version each thing arrived and what state it is in today, a 16-page kubectl cheat sheet sorted by what you want to do rather than alphabetically, a glossary of acronyms, and an index to come back to. And the why: where each decision comes from and what fails silently when you don't make it.

And there is a piece of the book that is also free, with no sign-up and no email: 31 pages in PDF with the Kubernetes architecture chapter (which has no module of its own here) and the complete Appendix D: Inside the cluster, which is the chapter behind module 14, with its eight diagrams exactly as they appear in print. If you want to see how the book explains this before deciding anything, download it and judge for yourself: javivela.dev/libros/kubernetes-101.

It's the same system

The book builds a tienda, piece by piece, and here you build it with your own hands. The names are the same, so if you have read the chapter you already know what to expect:

PieceWhat it isWhere it appears
webThe frontend. It starts out as a bare Pod and ends up as a Deployment with several replicas.Fundamentals, Workloads, Networking, Configuration, Scheduling
apiThe backend. It's the piece that scales and the one that gets hardened.Workloads, Scaling, Networking, Security
dbPostgreSQL. Stable identity and stable disk.Workloads, Storage, Networking
cacheRedis. One replica per node.Scheduling
agentThe log collector, one per machine.Workloads, Security
gatewayThe front door for traffic.Networking
backupsThe database dump, once and by hand.Workloads
reports / holgazanThe nightly report and the Deployment that asks for more than it needs (holgazan is Spanish for "slacker").Workloads, Scaling, Policies

And the book's Namespaces. From the first lesson you work inside tienda, even if you don't notice: the context already points there, so in most lessons you won't have to type -n. You'll see the flag only where it really matters, when a command crosses into another Namespace or when the tool demands it, as Helm does. plataforma shows up when it has to, which is when a piece doesn't belong in tienda: the agent with its hostPath, and the gateway that publishes everyone's traffic. The Security module is where you finally look at it head-on.

Which chapter goes with each module

Almost every module maps one to one onto its chapter, but there are three exceptions worth knowing if you are following the book:

  • Fundamentals covers two chapters: Talking to the cluster (chapter 3) and Kubernetes objects (chapter 4). They are done in one go because the first is kubectl and the second is what kubectl manipulates.
  • Inside the cluster covers chapter 2, Kubernetes architecture, and Appendix D. The chapter introduces the components; the appendix walks through them one by one, and the lab is the same.
  • Final challenge matches no chapter. It's the exam.

If you have downloaded the 31 free pages, that is exactly chapter 2 and Appendix D: the text behind module 14.

Four differences from the book, on purpose

The labs have to actually start on a shared playground, and that forces a few concessions. The book describes the complete system; here you'll see the version that fits on two nodes. None of them changes what you learn, but it helps to know them so you don't think you copied something wrong:

  • The images. The book uses tienda/web:1.4.2 and tienda/api:2.1.0, which are illustrative names. Here you'll see ghcr.io/iximiuz/labs/nginx:alpine, a real image mirrored in the platform's registry. The piece is the same; the difference is that this one exists and starts. The exception is the Containers module: there you build the real tienda/api:2.1.0 yourself and push it to the playground's registry, so during that module the book's name is literal.
  • The ports. That image is an nginx and listens on port 80, not on the 8080 of the book. The Services and probes in the lessons point at 80. The api you build in Containers does listen on 8080, as in the book.
  • The cluster, and what its nodes are called. The book's map draws three nodes and calls them node-1, node-2 and node-3. The k3s playground comes with two schedulable nodes and calls them node-01 and node-02, with a leading zero: the platform names them as it registers them, and they can't be changed. So if you copy a command from the book as-is (kubectl describe node node-1, nodeName: node-3) you'll get a NotFound; type the name you see in kubectl get nodes and you're done. And where the book spreads three cache replicas across three nodes, here you'll see two across two: the rule you learn is exactly the same, and in the book the map in chapter 12 shows the full spread. Several lessons also depend on there being exactly two, because with a third node a drain that gets blocked here would find room and stop proving anything.
  • The recomendador never gets to start, and its lab goes further than the book. It's the piece that asks for a GPU through Dynamic Resource Allocation, and there is none here. Even so, the resource.k8s.io types are core API and are in the playground, so the Scheduling lesson walks through the whole mechanism: the claim gets created, the scheduler keeps telling you what is missing, and you get as far as publishing a fake device by hand (something the book doesn't do) to watch the CEL selector reject the GPU that doesn't reach 24 GiB. The Pod stops one step short, at the driver, because that can no longer be simulated with YAML.

The module the book doesn't have

This course doesn't repeat the book: it continues it. There is one module that matches no chapter, and it is precisely the one you can't do by reading.

  • Final challenge. There is no matching chapter because there is nothing new to learn: you switch off the kube-scheduler of a live cluster and diagnose what stops working and what keeps working, which is not what almost anyone expects. It's the exam on everything that came before.

And there are three where the book goes halfway and the lab does the other half. In Extensibility, the chapter defines the tienda's Promocion CRD and explains what an operator does and why a CRD without one means nothing; here you write it: the whole operator, in Go and with controller-runtime, and you watch the reconciliation working in front of you. In Containers, the chapter takes the tienda/api:2.1.0 image for granted from the first page; here you build it yourself, layer by layer, turn it into a multistage build and push it to the cluster's registry. And in Scheduling, the chapter explains how a device is claimed with Dynamic Resource Allocation; here you get as far as publishing one by hand (something the book doesn't do) to watch the CEL selector reject the GPU that doesn't make the cut.

Inside the cluster, the second-to-last module, is the lab for chapter 2 and Appendix D. It comes at the end for the same reason the appendix does: the book explains the control plane components where they are needed (kube-proxy with the Service, the kube-scheduler with scheduling), and only once you have used them all is it worth seeing them together. It's also the only module, along with the final challenge, that runs on a kubeadm cluster instead of k3s: you need that to see each component on its own.

How it works

  • The course mixes two formats. The tutorials guide you step by step, with the YAML explained in questions and answers. The challenges, seven in all, drop you in with no script: most hand you a cluster with something broken for you to fix, and some ask you to build the piece or break it yourself. That's where you really learn.
  • Each lesson starts a real Kubernetes cluster in your browser, with nothing to install on your machine.
  • Verification is automatic: the course records your progress as you complete the tasks.
  • Go at your own pace and pick up where you left off from your dashboard.

About this course and the book

The two tell the same story from different sides: the course makes you do things, and the book explains why they are the way they are.

If you don't have the book, the course works just the same: it's open, it's free, and there is nothing to validate. When you finish a module and are left thinking "OK, it worked, but why?", that question is exactly the one the book answers. It's at javivela.dev/libros/kubernetes-101, with 31 downloadable pages so you can judge it first, and if the course has been useful to you, that is the best way to support it.

If you have the book, go chapter by chapter: at the end of each one you'll find the module that goes with it. The order here is the same.

A couple of honest things. This course is offered as-is, with no guarantee of availability or of working in the future: Kubernetes and the tools it uses change, and the scenarios can break. They are maintained on a best-effort basis. The platform that hosts the labs is a third party: the author takes no part in it or in running it, and its operation and data handling are its responsibility. The sign-up link on the book's page is a referral link, and if you register through it the author may receive compensation from the platform; nothing changes for you, because the course is free. If you find something broken, let me know.

The syllabus

  1. Containers (chapter 1): how an image is stacked in layers and why the order of the Dockerfile decides whether a rebuild takes seconds or minutes, all the way to building and pushing the tienda/api:2.1.0 that the rest of the course takes for granted.
  2. Fundamentals (chapters 3 and 4): web as your first Pod, your first broken Pod, and labels, selectors and annotations.
  3. Workloads (chapter 5): the longest module, with eight lessons and two challenges. The api probes, requests, limits and QoS, web turned into a Deployment with rollout and rollback, the db as a StatefulSet, the agent as a DaemonSet, init containers and sidecars, and the finite tasks (backups and reports).
  4. Scaling (chapter 6): the HPA that scales api and the VPA that fixes the holgazan.
  5. Networking (chapter 7): Services with internal DNS, the web Ingress with Traefik (the controller k3s ships with; the book uses NGINX in its examples, but the Ingress object is the same and only the annotations change), the gateway with Gateway API, the NetworkPolicies that isolate the db, and CoreDNS.
  6. Configuration (chapter 8): the web-config ConfigMap and the db-credentials Secret, the private registry credentials challenge, and the Downward API that tells the api who it is and where it runs.
  7. Storage (chapter 9): emptyDir, PersistentVolumeClaims and StorageClasses, with the db's disk.
  8. Security (chapter 10): Namespaces, RBAC and the agent's ServiceAccount, and Pod Security Admission on tienda.
  9. Policies (chapter 11): the ResourceQuotas and LimitRanges that put a budget on the tienda Namespace.
  10. Scheduling (chapter 12): affinities, taints and tolerations, priority and preemption, spreading cache across nodes, the web PDB and draining nodes, and the GPU the recomendador claims with Dynamic Resource Allocation.
  11. Working with the cluster (chapter 13): imperative debugging, mission style, the declarative flow with Kustomize, Helm, and the commands that don't show up in the manuals.
  12. Extensibility (chapter 14): define the tienda's Promocion CRD and write the operator that brings it to life, in Go and with controller-runtime.
  13. Observability (chapter 15): Events, metrics with kubectl top, and deploying a real stack with Prometheus, Grafana, Loki and VictoriaMetrics in the observabilidad Namespace.
  14. Inside the cluster (chapter 2 and Appendix D): the engine room, on a real kubeadm cluster, with each component linked to the place in the book that explains it.
  15. Final challenge (no chapter): switch off the scheduler and diagnose the cluster in open-heart surgery.

What you need

A browser and a free iximiuz Labs account, which is where the clusters run. Nothing else: the cluster, kubectl and the code editor are already set up in each lesson, and there is no code or coupon to enter. Start with the Fundamentals module: you create a Pod on the first screen, with nothing to install on your machine.

What's Inside?

About the Author

Javier Vela

Javier Vela

Find this author online