Skip to content

Conversation

maltesander
Copy link
Member

@maltesander maltesander commented Sep 4, 2025

Description

This PR add a new role controller to configure KRaft instead of ZooKeeper. This is prep work for Kafka 4.0, where ZooKeeper is removed.

fixes #690

BREAKING Changes:

  • renamed server.properties to broker.properties and controller.properties respectively (this affects e.g. config overrides)

What was done?

  • CRD:
    • make zookeeperConfigmapName optional
    • split KafkaConfig into Broker and Controller config
    • split out common configs (e.g. resources)
    • added controller role
    • split roles to own module
  • Product config:
    • clean out properties
    • remove zookeeper.connect, zookeeper.timeout (never used or overwritten in zk mode)
    • add controller to product config machinery
  • Implementation
    • Added sanity check to have Kafka4.0 / Controller and zookeeper mutually exclusive
    • introduce AnyConfig to better handle different config types
    • rework container commands and split to own module
      • KRaft formatting
      • node.id handling
    • rework resources (statefulset, configmap, service) and split to own module
    • increased default broker memory to 2gb
    • removed obsolete errors
    • better constants and config handling
    • hashing for "random" but deterministic integers for node.id
    • cluster-id is set to KafkaCluster metadata.uid
    • Kafka 4.0 support
    • log4j2 support
  • Tests:
    • Added use-kraft-controller dimension in almost all tests to split between Kraft / zk

What was not done?

  • (Stackable) Listener
  • Discovery

TODO

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@maltesander maltesander requested a review from razvan September 23, 2025 12:17
This was linked to issues Sep 25, 2025
razvan
razvan previously approved these changes Sep 26, 2025
Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

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

LGTM!

@maltesander maltesander added this pull request to the merge queue Sep 29, 2025
Merged via the queue into main with commit ecce270 Sep 29, 2025
17 checks passed
@maltesander maltesander deleted the feat/kafka-4.0 branch September 29, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/action-required Denotes a PR that introduces potentially breaking changes that require user action.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation: Update for kafka 4.x Update logging for Kafka 4.x Support deploying Kafka with KRaft instead of ZooKeeper for consensus building
2 participants