Skip to content

fix: clean up listeners and document the intended purpose #899

Description

@razvan

Description

This issue is a pre-requisite to continue working on the Kafka 4 issue.

Currently the Kafka op creates a whole bunch of listeners (both at Kafka as well as Kubernetes level) without a clear understanding of their purpose.

The term listener here is a compound term including:

  • a Kafka listener and advertised listerner property
  • the Kubernetes listener volume associated with it
  • the Kubernetes service associated with the listener volume.

The problem is that the code has become extremely complicated to maintain and extend, there are no tests for external access and no clear understanding if the status quo is actually correct or not.

For example:

  • There are client and client_auth listeners. This is redundant. The name of the client listeners should not change because a different authentication mechanism is used.

  • The naming is used interchangeably. In one part of the code client refers to client listeners and in others to internal broker listeners.

  • Bug: The bootstrap SVC is always defined but the corresponding Kafka (advertised) listener is only defined when Kerberos enabled.

    • ⚠️ This seems to be intentional but there are inconsistencies in the Kafka configuration.
  • When kerberos enabled, client listeners are left hanging. There is no client jaas configuration, no keytab, etc.

    • ✔️ The CLIENT listener does have a corresponding JAAS configuration and uses a different principal than the BOOTSTRAP listener.
  • There is no bootstrap-controller listener. This would be client interface for kraft controllers similar to the bootstrap listener for brokers.

    • ✔️ It's not clear is this is actually needed for any practical reasons.

Implementation Questions

  • ✔️ Bootstrap service questions
    • ✔️ In TLS mode, the bootstrap service scope is not included in the generated certs.
      • It is included.
    • ✔️ There is one internal service per pod but only one bootstrap service per role . Is this correct ?
      • This is intentional. The bootstrap SVC is supposed to be the only (stable?) address needed by Kafka clients.
  • ✔️ Kafka service properties are passed both via command line and configuration files. This is unnecessary complicated and hard to reuse. Fixed in : refactor: move server config props from cmd line to config files #911
  • ✔️ In Kerberos mode, the Java "jaas" properties are passed by command line. A better solution is to pass them as config files and also include the KafkaClient section. Partially fixed in : refactor: move server config props from cmd line to config files #911 . There is no KafkaClient entry in the JAAS file yet.
  • ✔️ Clarify what enabling Kerberos actually means?
    • Client/Broker authentication? Yes ✔️
    • Broker/Broker authentication ? Yes ✔️
    • Broker/Zookeeper authentication ? 🛑 No. The Kafka client for Zookeeper doesn't use Kerberos for authentication.
    • Kraft controllers authentication ? 🛑 No. Kraft controllers only have an SSL listener.
    • Kraft controllers/Brokers ? 🛑 No. Kraft controllers only have an SSL listener.
  • ❓ Kafka clients that connect using a bootstrap server will receive addresses of brokers from the associated (advertised) listener. In my understanding for every bootstrap service there should be a corresponding Kafka advertised listener.
    • In Kerberos mode, the BOOTSTRAP advertised listener is identical with the CLIENT advertised listener. Even the ports are the same (9093) even though the BOOTSTRAP listener binds to 0.0.0.0:9093. This is confusing and raises the question if the BOOTSTRAP advertised listener is actually used (because the tests are 🟢 ).
  • ❓ The Kafka advertised bootstrap listener configuration is actually using the broker advertised listener configuration for the host name. Bug ?
    • See above. I tried "fixing" the BOOTSTRAP advertised listener to use the bootstrap SVC address and the correct port (9095) but this doesn't work. The brokers won't even start because they are complaining that they all try to advertise the same (single) bootrstrap SVC address (which is true) and this is illegal.
  • ✔️ There is a cluster role called kafka-operator-kafka-broker-clusterrole and an associated command line argument to the operator that are not used anywhere. Fixed chore: remove unused RBAC role #914

Acceptance criteria

Activity

  1. self-assigned this
    on Oct 16, 2025
  2. moved this to Selected for Development in Stackable End-to-End Coordinationon Nov 5, 2025
  3. moved this to Development: In Progress in Stackable Engineeringon Nov 6, 2025
  4. moved this from Selected for Development to In Progress in Stackable End-to-End Coordinationon Nov 12, 2025
  5. moved this from In Progress to Done in Stackable End-to-End Coordinationon Nov 18, 2025
  6. moved this from Development: In Progress to Development: Done in Stackable Engineeringon Nov 18, 2025
  7. moved this from Development: Done to Development: Track in Stackable Engineeringon Nov 27, 2025
  8. moved this from Development: Track to Development: Done in Stackable Engineeringon Nov 27, 2025
  9. moved this from Development: Done to Acceptance: In Progress in Stackable Engineeringon Dec 1, 2025
  10. lfrancke commented on Dec 1, 2025

    @lfrancke
    Member

    This is a user facing change and should have a release note if I'm not mistaken.

    Can you link to the docs you mention in #915

  11. razvan commented on Dec 10, 2025

    @razvan
    MemberAuthor

    IMO the only user visible change is the removal if the unused cluster role.

    The listener cleanup was an internal refactoring and the docs are for developers only. They are here: https://github.com/stackabletech/kafka-operator/pull/915/files#diff-870a5366ae0e9a3ddc60d89e6ac1592504c632b92877810cdf7b995ed0fd7d65R39

  12. moved this from Acceptance: In Progress to Done in Stackable Engineeringon Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions