Login to the Kafka Broker
kubectl exec -it ckaf-kafka-0 -c ckaf-kafka-broker bash
Commands
From the broker's shell you can execute the following commands:
Topic Commands
List Topics
/bin/kafka-topics.sh --list --bootstrap-server ckaf-kafka-headless:9092
Create Topic
/bin/kafka-topics.sh --bootstrap-server ckaf-kafka-headless:9092 --create --topic test /bin/kafka-topics.sh --bootstrap-server ckaf-kafka-headless:9092 --create --topic test2 --partitions 3
Publish Message
/bin/kafka-console-producer.sh --bootstrap-server ckaf-kafka-headless:9092 --topic test
>{"log":"value"}
Consume Messages
/bin/kafka-console-consumer.sh --bootstrap-server ckaf-kafka-headless:9092 --topic test
{"log":"value"}