Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Kafka GitOps Local Cluster

  1. Ensure you have docker, docker-compose, and the Kafka CLI tools installed.
  2. Clone the kafka-gitops repository.
  3. Navigate into the docker folder, e.g. cd ./kafka-gitops/docker.
  4. Start up the Kafka cluster by running docker-compose up -d.
  5. Validate the logs look good by running docker-compose logs.
  6. Create a test topic by running the following:
kafka-topics --bootstrap-server localhost:9092 --command-config --create --topic test --partitions 6 --replication-factor 1
  1. Validate the topic was created successfully:
kafka-topics --bootstrap-server localhost:9092 --command-config --list

Expected output:

  1. Delete the topic so we go back to having a fresh Kafka cluster.
kafka-topics --bootstrap-server localhost:9092 --command-config --delete --topic test
  1. Yay! We now have a local Kafka cluster running with security enabled using the SASL_PLAINTEXT protocol and a user test with password test-secret.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment