This is my Kafka configuration - showing only relevant portion for sake of brevity. I am running this on minikube.
kafka:
version: 3.2.1
replicas: 1
listeners:
- name: plain
port: 9092
type: internal
tls: false
- name: tls
port: 9093
type: internal
tls: true
- name: external
port: 9094
type: nodeport
tls: false
Once the cluster is up, kubectl get kafka my-cluster -o=jsonpath='{.status.listeners[?(@.name=="external")].bootstrapServers}{"\n"}' -n kafka reports the address to connect as 192.168.49.2:31777.
I am unable to publish with kcat as shown below. How do I get around this issue?
kcat -P -b 192.168.49.2:31777 -t my-topic
This is the error I see.
kcat -P -b 192.168.49.2:31777 -t my-topic
%4|1662979702.324|FAIL|rdkafka#producer-1| [thrd:192.168.49.2:31777/bootstrap]: 192.168.49.2:31777/bootstrap: Connection setup timed out in state CONNECT (after 30012ms in state CONNECT)
The following is a result of debugging instructions described in this article - Accessing Kafka: Part 2.
minikube ip
192.168.49.2
kubectl get no minikube -o=jsonpath='{range .status.addresses[*]}{.type}{"\t"}{.address}{"\n"}'
InternalIP 192.168.49.2
Hostname minikube
kubectl -n kafka exec my-cluster-kafka-0 -c kafka -it -- cat /tmp/strimzi.properties | grep advertised
advertised.listeners=CONTROLPLANE-9090://my-cluster-kafka-0.my-cluster-kafka-brokers.kafka.svc:9090,REPLICATION-9091://my-cluster-kafka-0.my-cluster-kafka-brokers.kafka.svc:9091,PLAIN-9092://my-cluster-kafka-0.my-cluster-kafka-brokers.kafka.svc:9092,TLS-9093://my-cluster-kafka-0.my-cluster-kafka-brokers.kafka.svc:9093,EXTERNAL-9094://192.168.49.2:30206
While host IP address is same, the port numbers for advertised external listeners seem to be different - 31777 and 30206. However, the error persists.
kcat -P -b 192.168.49.2:30206 -t my-topic
%4|1662979840.135|FAIL|rdkafka#producer-1| [thrd:192.168.49.2:30206/bootstrap]: 192.168.49.2:30206/bootstrap: Connection setup timed out in state CONNECT (after 30031ms in state CONNECT)