Skip to content

Commit

Permalink
[incubator/kafka] fix commands documentation in NOTES.txt (helm#22168)
Browse files Browse the repository at this point in the history
* add relative path to executable calls

Because the docker image's workdir is /opt/kafka and the binaries are in /opt/kafka/bin, the relative path './bin/' needs to be prepended to the binary calls in the `kubectl exec` commands

Signed-off-by: Zach Goodman <zjgoodman@utexas.edu>

* bump chart version

Signed-off-by: Zach Goodman <zjgoodman@utexas.edu>
  • Loading branch information
zjgoodman authored and Ian Levesque committed Jul 13, 2020
1 parent 995c886 commit 925a907
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion incubator/kafka/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
description: Apache Kafka is publish-subscribe messaging rethought as a distributed
commit log.
name: kafka
version: 0.21.0
version: 0.21.1
appVersion: 5.0.1
keywords:
- kafka
Expand Down
8 changes: 4 additions & 4 deletions incubator/kafka/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ You can connect to Kafka by running a simple pod in the K8s cluster like this wi
Once you have the testclient pod above running, you can list all kafka
topics with:

kubectl -n {{ .Release.Namespace }} exec testclient -- kafka-topics --zookeeper {{ .Release.Name }}-zookeeper:2181 --list
kubectl -n {{ .Release.Namespace }} exec testclient -- ./bin/kafka-topics.sh --zookeeper {{ .Release.Name }}-zookeeper:2181 --list

To create a new topic:

kubectl -n {{ .Release.Namespace }} exec testclient -- kafka-topics --zookeeper {{ .Release.Name }}-zookeeper:2181 --topic test1 --create --partitions 1 --replication-factor 1
kubectl -n {{ .Release.Namespace }} exec testclient -- ./bin/kafka-topics.sh --zookeeper {{ .Release.Name }}-zookeeper:2181 --topic test1 --create --partitions 1 --replication-factor 1

To listen for messages on a topic:

kubectl -n {{ .Release.Namespace }} exec -ti testclient -- kafka-console-consumer --bootstrap-server {{ include "kafka.fullname" . }}:9092 --topic test1 --from-beginning
kubectl -n {{ .Release.Namespace }} exec -ti testclient -- ./bin/kafka-console-consumer.sh --bootstrap-server {{ include "kafka.fullname" . }}:9092 --topic test1 --from-beginning

To stop the listener session above press: Ctrl+C

To start an interactive message producer session:
kubectl -n {{ .Release.Namespace }} exec -ti testclient -- kafka-console-producer --broker-list {{ include "kafka.fullname" . }}-headless:9092 --topic test1
kubectl -n {{ .Release.Namespace }} exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list {{ include "kafka.fullname" . }}-headless:9092 --topic test1

To create a message in the above session, simply type the message and press "enter"
To end the producer session try: Ctrl+C
Expand Down

0 comments on commit 925a907

Please sign in to comment.