Skip to content

examples: migrate kafka/kafka-mesh to KRaft, pin cp-kafka 8.4.1 - #1672

Open
phlax wants to merge 2 commits into
envoyproxy:mainfrom
phlax:kafka-kraft
Open

phlax wants to merge 2 commits into
envoyproxy:mainfrom
phlax:kafka-kraft

Conversation

@phlax

@phlax phlax commented Nov 23, 2026

Copy link
Copy Markdown
Member

confluentinc/cp-kafka:latest has moved to 8.x, which is KRaft-only and rejects the examples' ZooKeeper config — its entrypoint fails ub ensure KAFKA_PROCESS_ROLES before anything starts. That's why the cp-kafka digest-bump PRs #1657 (kafka) and #1665 (kafka-mesh) both fail the examples job (and why they were flaky before — the recent wait_for hardening just made the breakage deterministic).

This fixes both properly:

  • Pin off :latest -> confluentinc/cp-kafka:8.4.1@sha256:ea3cd1f... (the version :latest currently resolves to), in both examples.
  • Convert to single-node KRaft (broker + controller): drop the zookeeper service and Dockerfile-zookeeper, add KAFKA_NODE_ID / KAFKA_PROCESS_ROLES / CLUSTER_ID / controller listener + quorum. kafka-mesh's two clusters become two standalone KRaft nodes.
  • Envoy configs unchanged (they proxy the external broker listener, which is ZooKeeper-agnostic); verify.sh just drops zookeeper from UPARGS; docs updated to match.

Both examples verified green locally with 8.4.1. Supersedes #1657 and #1665.

Now pinned to a concrete version, dependabot will bump the version tag (toward latest) rather than only chasing :latest's digest.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The invalid 15-byte KRaft cluster ID causes kafka-cluster2 to fail storage initialization, blocking the documented bananas/blueberries flows and their verification.

1 open issue
What changed in this PR

Migrates the Kafka broker and Kafka mesh examples from ZooKeeper to KRaft to address startup failures with Confluent Kafka 8.x.

Changes:

  • Pins both Kafka images to version 8.4.1 with a digest.
  • Configures standalone broker/controller nodes and removes ZooKeeper.
  • Updates verification startup lists and documentation while leaving Envoy configurations unchanged.
File Description
kafka/​verify.sh Removes ZooKeeper from startup services.
kafka/​example.rst Removes ZooKeeper from sample container output.
kafka/​Dockerfile-zookeeper Deletes the unused ZooKeeper image definition.
kafka/​Dockerfile-kafka Pins Kafka to version 8.4.1 and digest.
kafka/​docker-compose.yaml Replaces ZooKeeper with single-node KRaft configuration.
kafka-mesh/​verify.sh Removes ZooKeeper from startup services.
kafka-mesh/​example.rst Describes KRaft clusters and removes ZooKeeper output.
kafka-mesh/​Dockerfile-zookeeper Deletes the unused ZooKeeper image definition.
kafka-mesh/​Dockerfile-kafka Pins Kafka to version 8.4.1 and digest.
kafka-mesh/​docker-compose.yaml Configures two independent single-node KRaft clusters.

Review effort: Balanced

KAFKA_LISTENERS: PLAINTEXT://kafka-cluster2:9092
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
CLUSTER_ID: N2QzOUExMjM0NTY3ODlB
confluentinc/cp-kafka:latest moved to 8.x, which is KRaft-only and rejects the
examples' ZooKeeper config (its entrypoint fails ub ensure KAFKA_PROCESS_ROLES),
breaking both examples on the cp-kafka digest bumps (envoyproxy#1657/envoyproxy#1665).

Pin the image to a concrete version, cp-kafka:8.4.1 (what :latest currently
is), and convert both examples to single-node KRaft (broker+controller): drop
the zookeeper service/Dockerfile, add KRaft env (NODE_ID, PROCESS_ROLES,
CLUSTER_ID, controller listener/quorum). Give each broker a healthcheck
(kafka-broker-api-versions on its own listener) so compose up --wait blocks
until the broker is actually serving — without it the first client op races
broker readiness under CI's parallel load and times out. envoy configs
unchanged; verify.sh drops zookeeper from UPARGS; docs updated.

Signed-off-by: Ryan Northey <ryan@synca.io>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An invalid KRaft cluster UUID prevents kafka-cluster2 from starting, and obsolete --broker-list options cause Kafka 4.x producer commands to fail.

3 open issues

Review effort: Balanced

KAFKA_OPTS: "-Dzookeeper.4lw.commands.whitelist=ruok"
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
CLUSTER_ID: N2QzOUExMjM0NTY3ODlB
Comment thread kafka/Dockerfile-kafka
@@ -1 +1 @@
FROM confluentinc/cp-kafka:latest@sha256:f1c091384a9fbbbe7db084583e3434800b9916744eeb0410b2500371ac95c157
FROM confluentinc/cp-kafka:8.4.1@sha256:ea3cd1f6493a3d393c84052a436073e307b5fdb9696e407478b06fa0068385a1
Signed-off-by: Ryan Northey <ryan@synca.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants