Tiny Kafka
This example demonstrates using Zarf to deploy a simple operator example, in this case, Strimzi Kafka Operator](https://strimzi.io/).
To view the example source code, select the Edit this page
link below the article and select the parent folder.
Prerequisites
Before the magic can happen you have to do a few things:
Install Docker. Other container engines will likely work as well but aren't actively tested by the Zarf team.
Install Kind. Other Kubernetes distros will work as well, but we'll be using Kind for this example since it is easy and tested frequently and thoroughly.
Clone the Zarf project for the example configuration files.
Build the package using
zarf package create examples/tiny-kafka
Create a Zarf cluster as described in the Initializing a Cluster Walkthrough
Instructions
Deploy the package
Run the following command to deploy the created package to the cluster
zarf package deploy zarf-package-tiny-kafka-amd64.tar.zst --confirm
Wait a few seconds for the cluster to deploy the package.
Access Kafka
Testing requires JDK and the Kafka tools: sudo apt install openjdk-14-jdk-headless
(on Ubuntu). More details can be found at https://kafka.apache.org/quickstart. Steps to test:
- Install JDK and extract the Kafka tools from the package
kafka.tgz
- Get the Nodeport:
NODEPORT=$(zarf tools kubectl get service demo-kafka-external-bootstrap -n kafka-demo -o=jsonpath='{.spec.ports[0].nodePort}{"\n"}')
- For pub:
./bin/kafka-console-producer.sh --broker-list localhost:$NODEPORT --topic cool-topic
- For sub:
./bin/kafka-console-consumer.sh --bootstrap-server localhost:$NODEPORT --topic cool-topic