// Module included in the following assemblies:
//
// getting-started.adoc

[id='deploying-example-clients-{context}']
= Deploying example clients

.Prerequisites
* An existing Kafka cluster for the client to connect to.

.Procedure

. Deploy the producer.
+
ifdef::Kubernetes[]
On {KubernetesName}, use `kubectl run`:
[source,shell,subs="+quotes,attributes"]
kubectl run kafka-producer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list _cluster-name_-kafka-bootstrap:9092 --topic _my-topic_
+
endif::Kubernetes[]
On {OpenShiftName}, use `oc run`:
+
[source,shell,subs="+quotes,attributes"]
oc run kafka-producer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list _cluster-name_-kafka-bootstrap:9092 --topic _my-topic_

. Type your message into the console where the producer is running.

. Press Enter to send the message.

. Deploy the consumer.
+
ifdef::Kubernetes[]
On {KubernetesName}, use `kubectl run`:
[source,shell,subs="+quotes,attributes"]
kubectl run kafka-consumer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server _cluster-name_-kafka-bootstrap:9092 --topic _my-topic_ --from-beginning
+
endif::Kubernetes[]
On {OpenShiftName}, use `oc run`:
+
[source,shell,subs="+quotes,attributes"]
oc run kafka-consumer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server _cluster-name_-kafka-bootstrap:9092 --topic _my-topic_ --from-beginning

. Confirm that you see the incoming messages in the consumer console.
