Skip to Content

Kafka

Add a Kafka event-streaming cluster to an environment, connect your services to it, manage topics and messages in the console, see Kafka Connect, and scale it to three brokers.

Kafka (Strimzi) runs an Apache Kafka cluster in your environment, in KRaft mode (no separate coordination service). Services you connect to it get the broker address in their variables and talk to it inside the environment.

Add Kafka

Pick it from the menu

On the canvas, click + Service, then Add-on (Kafka, email, and more), then Kafka (Strimzi) ("Event streaming platform for real-time data pipelines.").

The Add-ons menu: Kafka (Strimzi), Memcached, ProxySQL, Email (SMTP) and Scheduled tasks
The Add-ons menu: Kafka (Strimzi), Memcached, ProxySQL, Email (SMTP) and Scheduled tasks

Review and deploy

A Kafka (Strimzi) card appears on the canvas, Ready to deploy. Click it. The panel has no fields: "Deploys with the catalog defaults. Size, HA and connections are tuned on this sheet once it is running." It shows the add-on's name, kafka.

Kafka (Strimzi): Ready to deploy — creates it on Dev right away, with Remove from canvas and Deploy
Kafka (Strimzi): Ready to deploy — creates it on Dev right away, with Remove from canvas and Deploy

Click Deploy. Remove from canvas drops the card instead.

The catalog defaults are one broker (a single node that is both controller and broker), Kafka 4.2.0 and a 10 GiB volume. Ours was up within a few minutes; the card then shows Running.

Connect a service

Click the Kafka card, open Settings and go to Connections. Turn on the switch next to the service. The row shows staged.

Connections: nginx, staged, switch on
Connections: nginx, staged, switch on

Click Commit 1 change. The dialog lists nginx ⇄ kafka off → on. Click Deploy 1 change.

1 change to apply: Connections, nginx ⇄ kafka off → on, Deploy 1 change
1 change to apply: Connections, nginx ⇄ kafka off → on, Deploy 1 change

The service gets three variables, all set to the same broker address on port 9092:

VariableValue
KAFKA_BOOTSTRAP_SERVERSKafka's address in the environment, port 9092
KAFKA_BROKERSthe same
KAFKA_URLthe same

There is no user or password: services in the environment connect on port 9092 without credentials.

Create a topic and send a message

We ran the Kafka command-line tools from inside the environment. For that we deployed a second service from the public image apache/kafka:4.2.0 with the start command sleep infinity, made it a Worker (see Visibility and access), named it kafka-client and connected Kafka to it as above. Then we opened its Terminal tab (see Terminal and SSH) and clicked Connect.

Create the topic

# cd /opt/kafka/bin
# env | grep -E '^KAFKA_(BROKERS|BOOTSTRAP_SERVERS|URL)=' | cut -d= -f1 | sort
KAFKA_BOOTSTRAP_SERVERS
KAFKA_BROKERS
KAFKA_URL
# ./kafka-topics.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --create --topic orders --partitions 3 --replication-factor 1
Created topic orders.
# ./kafka-topics.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --describe --topic orders
Topic: orders   TopicId: EDUMVnmgSY2G4fjL1q8w-w PartitionCount: 3   ReplicationFactor: 1   Configs: min.insync.replicas=1
        Topic: orders   Partition: 0    Leader: 0       Replicas: 0     Isr: 0  Elr:    LastKnownElr:
        Topic: orders   Partition: 1    Leader: 0       Replicas: 0     Isr: 0  Elr:    LastKnownElr:
        Topic: orders   Partition: 2    Leader: 0       Replicas: 0     Isr: 0  Elr:    LastKnownElr:
The kafka-client Terminal: the three KAFKA_ variable names, Created topic orders, and the topic's three partitions on broker 0
The kafka-client Terminal: the three KAFKA_ variable names, Created topic orders, and the topic's three partitions on broker 0

Produce and consume

# echo "order 1001 placed" | ./kafka-console-producer.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --topic orders
# ./kafka-console-consumer.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --topic orders --from-beginning --max-messages 1
order 1001 placed
Processed a total of 1 messages
The Terminal: the producer sends order 1001 placed and the consumer reads it back
The Terminal: the producer sends order 1001 placed and the consumer reads it back

Your own services do the same with any Kafka client library, using KAFKA_BOOTSTRAP_SERVERS as the bootstrap servers.

High availability

Settings → HA shows High availability · Single node and Enable HA: "Enable HA for a one-way upgrade to a redundant cluster. Status details appear here once HA is on — there is no in-place downgrade."

High availability: Single node, Enable HA
High availability: Single node, Enable HA

Click Enable HA. The dialog explains what it does:

Enable high availability? Scales the KafkaNodePool to 3 dual-role brokers and raises topic replication factor / min ISR. This is a one-way upgrade
Enable high availability? Scales the KafkaNodePool to 3 dual-role brokers and raises topic replication factor / min ISR. This is a one-way upgrade

Click Enable HA again ("High availability enabled"). The section now reads 3 dual-role brokers · one-way (cannot scale back in place), with:

  • Cluster health: Status (Provisioning, then Ready), Replicas (for example 1/3 ready), Primary and Mode (KRaft dual-role).
  • Members: each broker with its state (running or pending), and a refresh button.
  • Kafka settings: Brokers 3, Default RF 3 and Min ISR 2.

Ours went from 1/3 ready to 3/3 ready in under a minute. The card on the canvas shows 3.

High availability on: Ready, 3/3 ready, three brokers running, Brokers 3, Default RF 3, Min ISR 2
High availability on: Ready, 3/3 ready, three brokers running, Brokers 3, Default RF 3, Min ISR 2
The Kafka (Strimzi) card: Running, 3
The Kafka (Strimzi) card: Running, 3

The new defaults take a few minutes to apply. A topic we created right after the click still got replication factor 1; one created a few minutes later got 3, with min.insync.replicas=2. Topics that existed before keep their replication factor: ours, orders, stayed at 1.

# ./kafka-topics.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --create --topic audit --partitions 3
Created topic audit.
# ./kafka-topics.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --describe --topic audit
Topic: audit    TopicId: WuslJBScRuOX2vYzRxvr6w PartitionCount: 3   ReplicationFactor: 3   Configs: min.insync.replicas=2
        Topic: audit    Partition: 0    Leader: 1       Replicas: 1,2,0 Isr: 1,2,0  Elr:    LastKnownElr:
        Topic: audit    Partition: 1    Leader: 2       Replicas: 2,0,1 Isr: 2,0,1  Elr:    LastKnownElr:
        Topic: audit    Partition: 2    Leader: 0       Replicas: 0,1,2 Isr: 0,1,2  Elr:    LastKnownElr:
# ./kafka-topics.sh --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --describe --topic orders | head -1
Topic: orders   TopicId: EDUMVnmgSY2G4fjL1q8w-w PartitionCount: 3   ReplicationFactor: 1   Configs: min.insync.replicas=2

There is no way back to a single broker in place. Each broker has its own 10 GiB volume.

Manage topics and messages

Click the Kafka card, open Settings and stay on Manage ("Topics, consumer groups, and Connect."). The console connects to Kafka when the section opens (Connecting to Kafka…).

Resource overview counts Brokers (ours: 1, Single node), Topics, Connectors, Consumer groups, Consumer lag and Connect. Its refresh button reloads the counts. They also reload after you create or delete a topic. For us that took up to half a minute.

Manage: Resource overview with Brokers 1 Single node, Topics 1, Connectors 0, Consumer groups 0, Consumer lag 0, Connect Off; Read-only and Allow writes; the Topics tab with the orders topic
Manage: Resource overview with Brokers 1 Single node, Topics 1, Connectors 0, Consumer groups 0, Consumer lag 0, Connect Off; Read-only and Allow writes; the Topics tab with the orders topic

The console starts Read-only. To create or delete topics, send messages or add connectors, turn on Allow writes. The label changes to Write mode. The browser tab remembers the choice until you close it. The button next to it (Refresh connection) reconnects.

Topics

Topics lists each topic with its Partitions and Repl. (replication factor). Refresh reloads the list. Show internal also lists Kafka's internal topics. Ours had none yet. A new Kafka shows No topics found.

With Allow writes on, Create topic appears above the list. Type a Name (placeholder my-topic). Set Partitions and Repl. factor, which both default to 1. Click Create. We created orders with 3 partitions. After about five seconds, "Topic "orders" created" appeared and the topic was in the list.

Write mode: Resource overview with Topics 1; Create topic with Name, Partitions and Repl. factor; the Topics list shows orders, 3 partitions, Repl. 1, and Delete
Write mode: Resource overview with Topics 1; Create topic with Name, Partitions and Repl. factor; the Topics list shows orders, 3 partitions, Repl. 1, and Delete

Click a topic's name to open it (see Browse messages). In write mode each row also has Delete. Ours showed "Topic "orders" deleted" after about ten seconds, and the topic was gone from the list.

Delete asks first: Delete topic <name>? warns that the topic and every message in it are deleted permanently, and that consumers and connectors that use it stop receiving data. Click Delete topic to remove it.

Send a message

Open Messages and turn on Allow writes. Produce message has a Topic menu ("Select topic…"), a Key field ("(optional)") and a Value box ("message body"). Pick orders, type 1001 as the key and order 1001 placed as the value, and click Produce. After a few seconds, "Message produced to "orders"" appears. The key is saved with the message and shows in Key when you browse. A key can't contain a tab or a line break.

Messages: Browse messages with Select topic…, and Produce message with Topic orders, Key 1001, Value order 1001 placed, and Produce
Messages: Browse messages with Select topic…, and Produce message with Topic orders, Key 1001, Value order 1001 placed, and Produce

Browse messages

Under Messages → Browse messages, pick a topic. Clicking a topic's name in Topics opens the same view below the list. Its header shows the topic, its partition count and RF, plus Total messages in the topic, Retention (ours: Cluster default) and Fetched, the number of messages loaded. Ours showed 1 and 1. The arrow goes back to the list. It has three tabs:

  • Messages: pick All partitions or one partition. Choose From beginning or Latest. Set how many to fetch: 100, 500 (the default), 1,000, 5,000 or 10,000. Search key or value… filters the rows you've fetched. Refresh fetches again. JSON and CSV download the fetched messages, for example orders-messages.csv. A bar chart shows when the fetched messages arrived. The table lists each message's Timestamp, Partition, Offset, Key and Value. The play button streams new messages. While it runs, the view switches to Latest and the button pauses the stream.
  • Partitions: each partition's Log end offset (the offset the next message gets), Leader, Replicas and ISR. Our message went to partition 0, so its log end offset was 1 and the other two were 0.
  • Configuration: the topic's own settings, for example min.insync.replicas 1.
The orders topic: Total messages 1, Retention Cluster default, Fetched 1; Messages tab with All partitions, From beginning, 500, search 'order', Refresh, JSON, CSV, a message-volume chart and the message on partition 0, offset 0, key 1001, value order 1001 placed
The orders topic: Total messages 1, Retention Cluster default, Fetched 1; Messages tab with All partitions, From beginning, 500, search 'order', Refresh, JSON, CSV, a message-volume chart and the message on partition 0, offset 0, key 1001, value order 1001 placed
The Partitions tab: partitions 0, 1 and 2 with Log end offset 1, 0 and 0, Leader, Replicas and ISR 0
The Partitions tab: partitions 0, 1 and 2 with Log end offset 1, 0 and 0, Leader, Replicas and ISR 0

Consumer groups

Groups lists the consumer groups. Refresh reloads it. A new Kafka shows No consumer groups.

Consumer groups: Refresh, No consumer groups.
Consumer groups: Refresh, No consumer groups.

Browsing messages in the console doesn't add a group here: it reads without committing offsets and removes its temporary group afterwards.

Kafka Connect

Connectors lists Kafka Connect connectors, with Refresh. A new Kafka shows No connectors yet: "Add a source or sink to stream data in or out of Kafka." On the overview, Connect reads Off. No Connect cluster runs until you create the first connector.

Connectors in write mode: Refresh, Add connector, No connectors yet
Connectors in write mode: Refresh, Add connector, No connectors yet

In write mode, Add connector opens the catalog, Add connector ("Stream data in or out of" plus the Kafka's name):

  • Sources ("Capture changes into Kafka topics"): Postgres CDC (Debezium) and MySQL/MariaDB CDC (Debezium).
  • Sinks ("Sync topics to a database or object store"): JDBC Sink, S3 Sink (RustFS), MongoDB Sink and ClickHouse Sink.

1 Shared on an entry means a matching add-on already runs in the environment. Ours was the PostgreSQL add-on.

Add connector: Sources — Postgres CDC (Debezium) with 1 Shared, MySQL/MariaDB CDC (Debezium); Sinks — JDBC Sink with 1 Shared, S3 Sink (RustFS), MongoDB Sink, ClickHouse Sink
Add connector: Sources — Postgres CDC (Debezium) with 1 Shared, MySQL/MariaDB CDC (Debezium); Sinks — JDBC Sink with 1 Shared, S3 Sink (RustFS), MongoDB Sink, ClickHouse Sink

Click an entry to open its form. Postgres CDC (Debezium) has three parts:

  • Connection: Connector name (placeholder my-connector), Max tasks (1), Source app (Shared (project)) and Source add-on (ours: postgresql (PostgreSQL)). "Host and credentials filled from shared / postgresql-…" means you don't type them.
  • Data scope: Tables to capture, with All, Clear and Filter tables…, and a checkbox for each table. "Leave tables empty to capture every table in the database. Each table becomes a topic: <prefix>.<schema>.<table>."
  • Options: Topic prefix (required, placeholder pg) and Replication slot (default kubero_debezium), "must be unique per connector".

At the bottom are Test connection, Cancel and Create connector. Create connector stays off until you enter a name: "Enter a connector name." Cancel goes back. We didn't create a connector.

Access

Settings → Access ("Connection details and the admin console.") shows Bootstrap: "In-cluster listeners for apps in this phase · plain :9092 · TLS :9093".

  • Plain (No TLS): the broker address on port 9092, the same address connected services get.
  • TLS (In-cluster TLS): the same host on port 9093.

Each address has a copy button. Below them are Brokers, Topics, Mode and Host. Environment snippet ("Paste into an app's variables for this phase") has a KAFKA_BOOTSTRAP_SERVERS= line and the TLS address as a comment, with a copy button. The section holds no user or password.

Access: Bootstrap, plain :9092 and TLS :9093 addresses with copy buttons, Brokers 1, Topics 1, and the Environment snippet with KAFKA_BOOTSTRAP_SERVERS
Access: Bootstrap, plain :9092 and TLS :9093 addresses with copy buttons, Brokers 1, Topics 1, and the Environment snippet with KAFKA_BOOTSTRAP_SERVERS

The Kafka panel

  • Deployment lists the add-on's deploys, for example Deploy running for strimzi/operator:1.3.1 and the Kafka image. Each row's ⋯ menu has Redeploy and Inspect Deployment.
  • Logs streams the output of every Kafka pod. Pod picks All pods or one pod: the brokers (…-dual-role-0, -1, -2), the entity operator and the Kafka exporter. Log source is App logs or System events. The time menu has Live tail, Last 15 minutes, Last 1 hour, Last 6 hours, Last 24 hours and All loaded, next to a search box.
  • Metrics has 2h, 24h and 7d and Refresh. Under Host resources, Memory usage ("Container RAM used by this add-on's pods.") and CPU usage ("CPU time used by this add-on's pods (millicores).") each show a line over time, with the avg and max for the range. Ours, a single broker in its first hour, averaged about 1.1k MiB and 400 mCPU.
  • Settings has a side menu: Manage, Access, HA, Connection, Storage and Delete. Manage and Access are described above. Storage lists each broker's volume with its use, for example 1.0 MiB / 10 GiB · 0% ("Volumes can only grow. Expansion depends on the storage class.").
Kafka Logs: All pods, App logs, Search logs, Live tail
Kafka Logs: All pods, App logs, Search logs, Live tail
Metrics, Host resources: Memory usage, avg 1.1k MiB, max 1.8k MiB, and CPU usage, avg 401 mCPU, max 693 mCPU, over two hours
Metrics, Host resources: Memory usage, avg 1.1k MiB, max 1.8k MiB, and CPU usage, avg 401 mCPU, max 693 mCPU, over two hours

Delete Kafka

Delete add-on needs every service disconnected first ("Disconnect all apps first."). In Connections, turn off each service, then commit and deploy (kafka-client ⇄ kafka on → off, nginx ⇄ kafka on → off). The KAFKA_ variables are removed from those services.

2 changes to apply: kafka-client ⇄ kafka on → off and nginx ⇄ kafka on → off
2 changes to apply: kafka-client ⇄ kafka on → off and nginx ⇄ kafka on → off

Then click Delete under Delete add-on ("Deletes kafka and its data."). The dialog asks Remove add-on? Click Remove.

Remove add-on? Its resources and data will be deleted. Cancel, Remove
Remove add-on? Its resources and data will be deleted. Cancel, Remove

The removal is staged: the card now shows Removes on commit. Click Commit 1 change. The dialog lists Add-ons · kafka · delete and warns "kafka is deleted permanently, with any data it holds." Type sudo delete kafka to confirm, then click Delete 1 resource.

On this page