Foreword
Read little, type a lot. The Docker books built the
notes application, with a small API in Go. Now it gets a
gateway: a door that every request has to pass through, that checks who
is knocking, how often and by which path, and that writes everything
down.
This gateway is called Kong. You learn it from the bottom up: first without a database with a single YAML file, then with decK from Git, with plugins for keys, JWT and rate limits, with Postgres, load balancing and TLS. You write your own plugin in Lua, observe Kong with Prometheus and Grafana, split it into control plane and data plane, and in the end run it as an ingress controller in Kubernetes.
This book works with Kong Gateway OSS 3.9, the free edition under the Apache license. You can rebuild everything without an account and without a license. What the Enterprise edition and Konnect add is shown in the Enterprise Notes and Day 14.
The book is aimed at backend, platform and ops people who are confident with Docker and HTTP and want to publish, secure and observe APIs centrally.
The Training Rules
- Type, don’t copy. Every command once yourself.
- Compare with Expected. After every drill you see what you should get. If it differs, that is where the real lesson is.
- Pass the checkpoint. Only when the check commands show what is listed there do you move on.
- Solve the challenge on your own. First the hint, then the solution.
- Lab values stay in the lab.
lab-api-key-123,lab-key-anna-123,lab-db-pw-123and all otherlab-…values are practice data. You never print real tokens, not even in the lab.
Warning: All output comes from real test runs. IDs, times and IP addresses will differ on your machine. What matters is what happens.
Structure of Each Training Day
| Section | Purpose |
|---|---|
| Briefing | The essentials in a few bullet points |
| Drills | Commands with expected output |
| Checkpoint | Individual check commands: did everything work? |
| Challenge | A task without instructions |
| Enterprise Note | What is different in production |
The Training Plan
| Part | Day | Unit |
|---|---|---|
| 1 – Getting to know Kong | 0 | The training ground |
| 1 | First start without a database | |
| 2 | Services and routes | |
| 3 | Declarative with decK | |
| 4 | Plugins | |
| 2 – Securing and operating | 5 | Consumers and keys |
| 6 | JWT with Keycloak | |
| 7 | Kong with Postgres | |
| 8 | Rate limiting and protection | |
| 9 | Upstreams and load balancing | |
| 10 | TLS | |
| 11 | A custom plugin in Lua | |
| 12 | Observing | |
| 3 – Distributed and on Kubernetes | 13 | Hybrid mode |
| 14 | Kong Ingress Controller | |
| Competition | 15 | Disaster drills |
| Appendix | A | Cheat Sheet |
| B | Final Exam |
The Lab
You work on an Ubuntu 24.04 VM kong with 2 CPUs and 4 GB
RAM, which you start with Multipass, and you work over SSH on the VM.
For Day 13 a small second VM dp joins, for Day 14 a VM
k3s. Any other Ubuntu VM with SSH, sudo and
internet access works too.
The tested versions: Kong Gateway OSS 3.9.4, decK 1.69.0, Keycloak 26.8.1, Postgres 18.6, Kong Ingress Controller 3.5.14 and k3s v1.36.5.
Where this book only touches on an area, the sister books go deeper: “Docker Compose hands-on” for the backend, “Kubernetes hands-on” for Day 14, “Gateway API hands-on” for routing with Envoy Gateway.
Let’s go.