Diskless Kafka: Same Clients, No Disk
Docker demo of WarpStream, a Kafka-compatible Agent with no data disk: stock Kafka tools and a Python client run against it locally and against a hosted control plane built with Terraform.
Overview
You point kafka-console-producer at a new address and nothing else changes. No new library, no flag, no code. You create a topic, write three records, read them back, and the Agent that served you has no volume mounted. The records are objects in a bucket.
A classic broker is a warehouse that keeps its stock on its own shelves and copies every box to two other warehouses. A diskless Agent is a counter with no shelves: every box goes to a shared storage unit, and any counter can serve any customer. The one thing the counter cannot do alone is remember which box is which. That index has to live somewhere, and this repo shows where.
The repo runs WarpStream’s Agent in Docker, writes to MinIO as an S3-compatible bucket, and throws the stock Apache Kafka CLI tools and the Python confluent-kafka client at it, in two modes.
How it works
- Local mode.
warpstream localruns a self-contained cluster with a fake in-memory control plane. Docker is the only requirement. - Hosted mode. Terraform creates a WarpStream BYOC virtual cluster and an agent key. The same Agent image runs as
agent, connects to that cluster, and still writes records to the local bucket. Only metadata goes to the control plane. - The checks. A Python suite covers admin and config, headers, consumer groups, idempotent producers, transactions with
read_committed, compaction config, timestamp lookup, and Schema Registry. - The proof.
docker inspectshows no mounts on the Agent, and the records appear as objects in the bucket.
Kafka CLI tools + Python client (unmodified)
│ Kafka protocol, warpstream:9092
▼
WarpStream Agent (no volume)
│ │
│ S3 API │ metadata only (hosted mode)
▼ ▼
MinIO bucket control plane ◄── terraform: virtual cluster + agent key
(the records) (topics, offsets)
What it demonstrates
- Clients work as they are. Locally 7 of 8 checks passed. Against the hosted cluster, 6 of 7 passed and one was skipped, because Schema Registry is a separate Agent service that mode does not run.
- One honest failure.
offsets_for_timesreturned coarse answers in both modes, and WarpStream’s own documentation describes the time index as approximate. A consumer group reset to a datetime before all records landed on offset 0, and a reset to after all records landed on the log end. A mid-range datetime was not tested. - Metadata is the real state. Restart the local-mode Agent and the topics are gone while the objects stay in the bucket. Against the hosted control plane, the topic and all 3 records survived a restart, and again after the container was removed and a brand new one started.
Technical details
- Stack: Docker Compose, MinIO, the WarpStream Agent (v860), Apache Kafka 3.9 CLI tools, Python with
confluent-kafka2.6.1, and Terraform with thewarpstreamlabs/warpstreamprovider. - The bucket URL:
s3://<bucket>?region=us-east-1&endpoint=http://minio:9000&s3ForcePathStyle=true, with the MinIO credentials in the usual AWS environment variables. - Secrets stay out of files. The agent key is read from the Terraform outputs when the script runs and passed to the container as an environment variable. The Terraform state is local and git-ignored, and it contains that key.
- Tags. The virtual cluster carries owner, service, managed-by, project and keep-until tags. The owner values come from
.env, not from the files in the repo. - What it does not claim: no cost, availability-zone or latency numbers. A laptop has no zones, and the hosted run adds a round trip to the control plane region.
Challenges & lessons
- Local mode forgets on purpose. Its control plane is in memory, so a restart empties the topic list while the bucket keeps its objects. That is not a flaw in the product, and the hosted run shows the same Agent keeping its topics. It does show that diskless removes the disk from the broker, not the need for a metadata layer.
- Coarse is not wrong. The timestamp lookup returned offset 9 for most records in a 15 second window, and waiting 60 seconds changed nothing. It is rare in normal operation but it is the path people use to replay after an incident, so for an exact time boundary, filter on record timestamps in the consumer.
- The names are strict. WarpStream wants virtual cluster names that start with
vcn_and contain only letters, digits and underscores, and agent keys that start withakn_. Terraform builds the name so the value in.envcan stay readable. - There is no London region. Asking for
eu-west-2fails withvirtual_cluster_region_invalid. The control plane region only decides where metadata lives, soeu-central-1was fine with the Agent on a laptop. - The provider wants an application key. The provider documentation requires one for virtual clusters and agent keys, so an account key is the wrong thing to hand it.
- Small bugs in my own scripts taught the most. An output filter returned exit code 1 when nothing was left to print, and
set -equietly ended the demo. A Python admin client was garbage-collected before its result arrived, which looked like a broker error. A MinIOlatestimage could no longer be pulled, so the repo pins a release.