Kates — The Definitive Guide
Kafka Advanced Testing & Engineering Suite
A comprehensive guide to performance testing, chaos engineering, and operational resilience for Apache Kafka — from theory to practice.
Table of contents
Preface
You run the payments platform, and before it moves onto krafter, the Kafka cluster under test, you have to say whether the cluster can carry it. Two things would sink the move: writes that slow down once the real load arrives, and a broker failure that loses a payment the cluster had already acknowledged. This book turns both into targets that a Kates run can check:
kraftertakes 2,000 records per second of 1 KiB withacks=all, and answers writes with a P99 of 100 ms or less from send to acknowledgment.krafterloses no acknowledged record when one broker or one zone fails.
Kates calls thresholds like these SLAs, though they’re SLO-style targets that you set, not agreements with anyone. The book shows you how to run the checks on a lab on your own machine, how to read what they report, and then how to run them again on a cluster you operate.
What This Book Covers
Kates (Kafka Advanced Testing & Engineering Suite) is the tool that runs the checks. It has two halves: the kates CLI on your machine, and the Kates API, a service that runs in Kubernetes beside the Kafka cluster it tests. The Kates API generates the load, asks LitmusChaos or Kubernetes for the faults, grades disruption plans and keeps every run in PostgreSQL, so an earlier run is still there to compare a new one against. The screenshot shows the CLI’s command overview next to a LOAD run’s throughput and gate summary:

Who This Book Is For
The book is for the people who run, test or are about to inherit an Apache Kafka cluster. The table gives, for each of their jobs, the chapter to start with and the chapters to read next:
| Reader | Start here | Then read |
|---|---|---|
| Platform engineer deploying Kafka | Installing Kafka with the kafka-cluster Helm Chart | Kafka Deployment Engineering, Deployment Guide |
| SRE or reliability engineer | Chaos Engineering Theory | Chaos Engineering in Practice, Observability & Monitoring |
| Performance engineer | Performance Theory | Test Types Deep Dive, CLI Reference |
| Security engineer | Security & Compliance | Troubleshooting Index |
| Developer using the API | REST API Reference | gRPC API Reference, Scenario Files & SLA Gates |
The table is for a job you have to do this week. On a first reading, go in order: every row assumes the lab and the model of a test run that Part I builds.
How to Read This Book
Read Parts I to IV in order, because each one adds a piece of the answer and uses the pieces before it. Part I — Foundations builds the lab and a first LOAD report. Its chapters Architecture & Design and The Cluster Under Test give you the model of a test run and the cluster behind every number you measure. Part II — Performance Testing writes payments-scenarios.yaml, whose gates encode the throughput and P99 targets, and records its LOAD baseline.
Part III — Chaos & Integrity checks the second target. It reuses the test types of Part II to measure what a fault costs, and ends with two graded disruption plans and two integrity verdicts, one for a lost broker and one for a lost zone. Part IV — Observability explains why a run produced the numbers it did.
Part V — Deployment & Operations moves the question from the lab to a cluster you run: the tenant block, a re-test around an upgrade and the readiness sign-off. Its chapters are for the day you deploy, secure, upgrade or extend a cluster. Part VI — Reference and the appendices are for looking things up.
Each Part opens with a page that lists its chapters, with the question each one answers, and links the tutorials that go with them. On the pages of Parts I to V, a section such as Part I’s The Payments Question says what the Part adds toward the answer.
Before You Start
The book’s exercises run against a lab on your own machine, so set it up before you reach the Quick Start in Introduction.
You don’t need to know Kafka’s internals first. The Cluster Under Test explains the replication settings, acks, the in-sync replicas and the controller quorum behind every test, in its Replication Configuration section, and the Glossary defines the terms the book uses. You do need to be at home at a shell prompt and with kubectl.
The Deployment Guide’s Prerequisites table lists the tools the lab needs, with their versions. For the machine, Installing Kafka with the kafka-cluster Helm Chart asks for a Kubernetes cluster with at least 16 GB of memory and 6 CPU cores, and recommends 24 GB and 12 cores. On Kind, the memory and cores come from Docker.
The lab needs no checkout of the repository: Homebrew installs the tools and the CLI, brew install kind kubectl helm bmscomp/tap/kates, and kates deploy --topology isolated builds the lab from the charts its release published. The isolated topology gives Kafka, Kates and the chaos tooling a namespace each, which the Quick Start assumes; --topology single puts them together in kates-stack. When no cluster is reachable, kates deploy offers to create the panda Kind cluster first. Otherwise it checks which clusters your kubeconfig reaches. When only the current context answers, it deploys there. When more than one answers, it asks which one to use, starting on the current context, and when only another cluster answers, it asks before deploying there. The cluster it deploys to becomes kubectl’s current context, and when that changes, kates deploy prints the kubectl config use-context command that switches back.
Two names recur throughout the book. panda is the Kind cluster: its three nodes are named after the zones they stand for, alpha, sigma and gamma, and Kafka spreads its brokers across them. krafter is the Kafka cluster under test, which The Cluster Under Test describes.
The Kates Tutorials are for practice, and the book is for explanation. Each tutorial walks through one workflow on the lab, step by step, while the chapters explain why it works; each Part page links the tutorials that go with its chapters.
Versions This Book Targets
The book tracks the versions the repository pins, the Kates charts and Kafka among them. The Version & Compatibility Matrix lists them all and is generated from versions.env. When a chapter and the matrix disagree, the matrix wins.
Conventions
The same conventions hold in every chapter. The table says what each one means:
| Convention | What it means |
|---|---|
| A shell command | It carries no prompt character, so copy it as it is. |
A kubectl command |
It assumes a kubeconfig pointing at your cluster. |
A kates command |
It assumes the CLI is installed and configured with a context that carries the API key, as the Quick Start in Introduction sets up. |
A curl or grpcurl example |
It assumes the API is forwarded to localhost:30083, and reads the key from $KATES_API_KEY, exported as shown in REST API Reference. |
A code block whose first line is a comment naming a file, such as # kafka-eks.yaml |
A file you create or edit. |
A text block after a line that reads Output: |
What the command before it printed. IDs, times and figures differ from run to run. |
<id> in a command |
A placeholder for an ID that an earlier command printed, such as a test run’s. |
| LOAD, ROUND_TRIP and the other test types in capitals | Kates test types, spelled as the API spells them. Lowercase “round-trip” is the general idea of round-trip latency. |
| A Note callout | Context worth knowing. |
| A Tip callout | A shortcut or a good practice. |
| An Important callout | A constraint you must not miss. |
| A Warning callout | A risk of breaking something. |
| A Caution callout | A risk of losing data or causing downtime. |
| A Tip callout that opens with Try it | An exercise to run on your lab. |
| “About N minutes” on a Part page | The chapter’s prose read at 200 words a minute and rounded to 5 minutes, code blocks left out, so time at the keyboard comes on top. |
Source Code
The source code for Kates is on GitHub at github.com/bmscomp/kates, under the Apache 2.0 license. Once the lab is up, start with the Introduction: it says what Kates tests that a generic load tool can’t, and its Quick Start runs your first LOAD test against krafter.