The outside brokers are bound to 192.168.49.2:32400/32401/32402. The ip is from minikube VM, and can't be reached on host machine. I tried 2 ways to make them accessible:
use minikube tunnel to generate random host ports
use kubectl port-forwad svc/outside-0 32400:32400 -n kafka
Both ways expose brokers to host (take the second way for demonstration), and I tested it with kafkacat (there is one topic 'test' in kafka):
~ kafkacat -L -b localhost:32400
Metadata for all topics (from broker -1: localhost:32400/bootstrap):
3 brokers:
broker 0 at 192.168.49.2:32400 (controller)
broker 2 at 192.168.49.2:32402
broker 1 at 192.168.49.2:32401
1 topics:
topic "test" with 12 partitions:
partition 0, leader 2, replicas: 2,1,0, isrs: 0,2,1
partition 1, leader 1, replicas: 1,0,2, isrs: 0,2,1
partition 2, leader 0, replicas: 0,2,1, isrs: 0,2,1
......
But I failed to produce to or consume from kafka, either with kafkacat tool or programmatically:
~ kafkacat -C -b localhost:32400 -t test -o beginning
%5|1607918729.228|REQTMOUT|rdkafka#consumer-1| [thrd:192.168.49.2:32402/2]: 192.168.49.2:32402/2: Timed out ApiVersionRequest in flight (after 10035ms, timeout #0)
%5|1607918729.228|REQTMOUT|rdkafka#consumer-1| [thrd:192.168.49.2:32400/0]: 192.168.49.2:32400/0: Timed out ApiVersionRequest in flight (after 10035ms, timeout #0)
%5|1607918729.228|REQTMOUT|rdkafka#consumer-1| [thrd:192.168.49.2:32401/1]: 192.168.49.2:32401/1: Timed out ApiVersionRequest in flight (after 10035ms, timeout #0)
%4|1607918729.228|REQTMOUT|rdkafka#consumer-1| [thrd:192.168.49.2:32401/1]: 192.168.49.2:32401/1: Timed out 1 in-flight, 0 retry-queued, 0 out-queue, 0 partially-sent requests
From the output we can see the client on host trying to talk to brokers with IP 192.168.49.2(which is minikube VM ip), so the operation fails.
Background
I use minikube on Mac. Zookeeper + Kafka + outside brokers(NodePort) are all deployed successfully. Here is the status:
Get brokers IP:
Problem
The outside brokers are bound to 192.168.49.2:32400/32401/32402. The ip is from minikube VM, and can't be reached on host machine. I tried 2 ways to make them accessible:
minikube tunnel
to generate random host portskubectl port-forwad svc/outside-0 32400:32400 -n kafka
Both ways expose brokers to host (take the second way for demonstration), and I tested it with kafkacat (there is one topic 'test' in kafka):
But I failed to produce to or consume from kafka, either with
kafkacat
tool or programmatically:From the output we can see the client on host trying to talk to brokers with IP 192.168.49.2(which is minikube VM ip), so the operation fails.
Anyone can help?