bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.93k stars 9.18k forks source link

[bitnami/kafka] Kafka on Minikube for external access not working as expected. #25024

Closed smartnose closed 5 months ago

smartnose commented 6 months ago

Name and Version

bitnami/kafka-28.0.3

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. I am running Minikube (v1.32.0) on Ubuntu 24. and I followed your latest documentation on how to expose Kafka for external access (see my values.yaml below).
  2. I have metallab installed, and verified that the external IP has been assigned (see screenshot)
  3. Verified that the producers/consumers are working fine within the cluster
  4. Verified that the external ips are properly included as advertisedListeners and the authentication is set to PLAINTEXT

External IPs are assigned properly

However, when I connect it from outside the cluster using Kafka CLI, I'm still getting error message Error while executing topic command : Timed out waiting for a node assignment. Call: listTopics.

./kafka-topics.sh --bootstrap-server 192.168.49.73:9094 I double verified that the IP and port numbers are correct (accessible through Telnet)

I also tried to add client.properties like this (trying to match the password I found in server.properties and I'm getting the same error.

sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
    username="user1" \
    password="wOLBy91aJ1";

See server.properties in one of the broker pod.

listeners=CLIENT://:9092,INTERNAL://:9094,EXTERNAL://:9095,CONTROLLER://:9093
advertised.listeners=CLIENT://kafka-controller-0.kafka-controller-headless.quark.svc.cluster.local:9092,INTERNAL://kafka-controller-0.kafka-controller-headless.quark.svc.cluster.local:9094,EXTERNAL://192.168.49.74:9094
listener.security.protocol.map=CLIENT:PLAINTEXT,INTERNAL:SASL_PLAINTEXT,CONTROLLER:PLAINTEXT,EXTERNAL:SASL_PLAINTEXT
# KRaft process roles
process.roles=controller,broker
node.id=0
controller.listener.names=CONTROLLER
controller.quorum.voters=0@kafka-controller-0.kafka-controller-headless.quark.svc.cluster.local:9093,1@kafka-controller-1.kafka-controller-headless.quark.svc.cluster.local:9093,2@kafka-controller-2.kafka-controller-headless.quark.svc.cluster.local:9093
# Kafka data logs directory
log.dir=/bitnami/kafka/data
# Kafka application logs directory
logs.dir=/opt/bitnami/kafka/logs

sasl.enabled.mechanisms=PLAIN,SCRAM-SHA-256,SCRAM-SHA-512
# Interbroker configuration
inter.broker.listener.name=INTERNAL
sasl.mechanism.inter.broker.protocol=PLAIN
# Listeners SASL JAAS configuration
listener.name.internal.plain.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="inter_broker_user" password="0vPhfeF5sW" user_inter_broker_user="0vPhfeF5sW" user_user1="wOLBy91aJ1";
listener.name.internal.scram-sha-256.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="inter_broker_user" password="0vPhfeF5sW";
listener.name.internal.scram-sha-512.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="inter_broker_user" password="0vPhfeF5sW";
listener.name.external.plain.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required user_user1="wOLBy91aJ1";
listener.name.external.scram-sha-256.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required;
listener.name.external.scram-sha-512.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required;
# End of SASL JAAS configuration

Are you using any custom parameters or values?

auth:
  clientProtocal: 'PLAINTEXT'
  interBrokerProtocol: 'PLAINTEXT'
externalAccess:
  enabled: true
  service:
    broker:
      type: LoadBalancer
      ports:
        external: 9094
  controller:
    type: LoadBalancer
    containerPorts:
      external: 9094
  autoDiscovery:
    enabled: true
serviceAccount:
  create: true
rbac:
  create: true
controller:
  automountServiceAccountToken: true
broker:
  automountServiceAccountToken: true
listeners:
  client:
    protocol: 'PLAINTEXT'
  controller:
    protocol: 'PLAINTEXT'

What is the expected behavior?

I'd expect the CLI command running outside the cluster should also be able to list the topic as inside k8s

What do you see instead?

Error while executing topic command : Timed out waiting for a node assignment. Call: listTopics
[2024-04-06 14:00:53,921] ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listTopics
 (org.apache.kafka.tools.TopicCommand)

Additional information

No response

javsalgar commented 6 months ago

Hi!

Could you try again disabling the network policies? With networkPolicy.enabled=false. Just to ensure that the issue is not there.

github-actions[bot] commented 5 months ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 5 months ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.