stackabletech / stackabletech/kafka-operator

Setting advertised listeners is not propagated to broker

Open
#564 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Rust
Stars
28
Forks
8
Avg merge
2d 12h
Merged PRs (30d)
9

Description

Affected version

docker.stackable.tech/stackable/kafka-operator:23.1.0

Current and expected behavior

Requirement: Giving access to Kafka brokers from within a k8s cluster.

Currently, only the external cluster IP is per default advertised by brokers. For my particular setup, this IP:port address isn't and shouldn't be accessible, not from inside or outside of the cluster.

When trying to set the advertised.listeners property of Kafka through KafkaCluster, it is not picked up by the broker configuration, see configuration below. This results in Kafka being effectively not usable in this particular scenario.

  brokers:
    roleGroups:
      default1:
        replicas: 1    
      rg1:
        replicas: 1
        configOverrides:
          server.properties:
            advertised.listeners: CLIENT://stack-kafka-broker-rg1-0.mynamespace:9092

kcat shows that brokers still advertise the original external ip regardless of the override.

the brokers configmap contains the override:

5 apiVersion: v1
6 data:
7   log4j.properties: ""
8   server.properties: |
9     advertised.listeners=CLIENT\://stack-kafka-hbdedpmdsf-broker-rg1-0.mynamespace\:9092

yet, the broker itself still does it's own override using the node port (CLIENT://$NODE:$(cat /stackable/tmp/kafka_nodeport)), not preferring the intended override:

  bin/kafka-server-start.sh /stackable/config/server.properties --override "zookeeper.connect=$ZOOKEEPER" --override "listeners=CLIENT://0.0.0.0:9092,INTERNAL://0.0.0.0:19093" --override "advertised.listeners=CLIENT://$NODE:$(cat /stackable/tmp/kafka_nodeport),INTERNAL://$POD_NAME.stack-kafka-hbdedpmdsf-broker-rg1.mynamespace.svc.cluster.local:19093" --override "listener.security.protocol.map=CLIENT:PLAINTEXT,INTERNAL:SSL"
Possible solution

No response

Additional context

No response

Environment

No response

Would you like to work on fixing this bug?

None

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace how KafkaCluster broker configOverrides are rendered into server.properties and how the bin/kafka-server-start.sh command applies advertised.listeners overrides. Reproduce the issue with the shown configuration and verify that the configured advertised.listeners value is honored in broker metadata instead of being replaced by the node-port value.

Written by the indexing model from the issue text.

Assessment

Tech stack
kafka, kubernetes, rust
Domain
distributed-systems, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.