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

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

[role="_abstract"]
Send and receive messages from a Kafka cluster installed on Kubernetes.

This procedure describes how to deploy Kafka clients to the Kubernetes cluster, then produce and consume messages to test your installation.
The clients are deployed using the Kafka container image.  

.Prerequisites

* The Kafka cluster is available for the clients.

.Procedure

. Deploy a Kafka producer.
+
This example deploys a Kafka producer that connects to the Kafka cluster `my-cluster`.
+
A topic named `my-topic` is created.
+
.Deploying a Kafka producer to Kubernetes
[source,shell,subs="+attributes"]
kubectl run kafka-producer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-producer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic

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

. Press *Enter* to send the message.

. Deploy a Kafka consumer.
+
The consumer should consume messages produced to `my-topic` in the Kafka cluster `my-cluster`.
+
.Deploying a Kafka consumer to Kubernetes
[source,shell,subs="+attributes"]
kubectl run kafka-consumer -ti --image={DockerKafka} --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning

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