Managing topics

Topics can be managed declarativaly with the Strimzi Topic Operator.

The Strimzi Topic Operator runs in unidirectional mode. With this mode, you can create topics with the KafkaTopic resource, which are then managed by the Strimzi Topic Operator. Since the Strimzi Topic Operator only manages topics which have corresponding KafkaTopic resources, if a managed topic’s configuration is changed directly in the Kafka cluster, those changes will be reverted.

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
  name: my-topic
  labels:
    strimzi.io/cluster: my-cluster
spec:
  partitions: 1
  replicas: 1
  config:
    retention.ms: 7200000
    segment.bytes: 1073741824

You can list topic resources with kubectl get.

kubectl get kafkatopics --output wide --namespace [***NAMESPACE***]