Dockerfile for Apache Kafka

The image is available directly from:

  • PROD:
  • DEV:


Create the template oc create -f ose-artefacts/template-appagile-kafka.yaml

Start a cluster:

You have to provide a Zookeeper endpoint in order to start a Kafka container. The cluster endpoint can be used here: e.g. “..svc.cluster.local

Add more brokers:

The image is scalable via the replication controler. The Zookeeper config should be updated automatically.

Broker IDs

The broker id will automatically be generated. Usually, it starts with 1001.

Advertised hostname

The advertised hostname is generated and includes the name of the pod.


The Kafka-logs are stored under /kafka. The path is persistent and configured to a PV.

Kafka commands

$ oc rsh <kafka-pod>

Create topic

2 Replicas:
$ /opt/kafka_2.11- –zookeeper $KAFKA_ZOOKEEPER_CONNECT –create –topic bee.msgs –partitions 3 –replication-factor 2

1 Replica:
/opt/kafka_2.11- –zookeeper $KAFKA_ZOOKEEPER_CONNECT –create –topic test.msgs –partitions 3 –replication-factor 1

List topic

$ /opt/kafka_2.11- --list --zookeeper $KAFKA_ZOOKEEPER_CONNECT

Describe topic

$ /opt/kafka_2.11- --describe --zookeeper $KAFKA_ZOOKEEPER_CONNECT --topic bee.msgs