@@ -10,10 +10,13 @@ kubectl exec -ti testclient -- ./bin/kafka-console-consumer.sh --zookeeper zooke
10
10
11
11
# Go ahead and produce messages
12
12
echo " Write a message followed by enter, exit using Ctrl+C"
13
- kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka-0.broker .kafka.svc.cluster.local:9092 --topic test1
13
+ kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list broker-0 .kafka.svc.cluster.local:9092 --topic test1
14
14
15
- # Bootstrap even if two nodes are down (shorter name requires same namespace)
16
- kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka-0.broker:9092,kafka-1.broker:9092,kafka-2.broker:9092 --topic test1
15
+ # Bootstrap even if two nodes are down
16
+ kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list broker-0.kafka.svc.cluster.local:9092,broker-1.kafka.svc.cluster.local:9092,broker-2.kafka.svc.cluster.local:9092 --topic test1
17
+
18
+ # Get a broker through the service
19
+ kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka.kafka.svc.cluster.local:9092 --topic test1
17
20
18
21
# The following commands run in the pod
19
22
kubectl exec -ti testclient -- /bin/bash
@@ -22,13 +25,13 @@ kubectl exec -ti testclient -- /bin/bash
22
25
./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topic test2
23
26
24
27
./bin/kafka-verifiable-consumer.sh \
25
- --broker-list=kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker .kafka.svc.cluster.local:9092 \
28
+ --broker-list=kafka.kafka.svc.cluster.local:9092 \
26
29
--topic=test2 --group-id=A --verbose
27
30
28
31
# If a topic isn't available this producer will tell you
29
32
# WARN Error while fetching metadata with correlation id X : {topicname=LEADER_NOT_AVAILABLE}
30
33
# ... but with current config Kafka will auto-create the topic
31
34
./bin/kafka-verifiable-producer.sh \
32
- --broker-list=kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker .kafka.svc.cluster.local:9092 \
35
+ --broker-list=kafka.kafka.svc.cluster.local:9092 \
33
36
--value-prefix=1 --topic=test2 \
34
37
--acks=1 --throughput=1 --max-messages=10
0 commit comments