How to delete Topics in Kafka

Deleting Kafka Topics using Kowl
This will delete all the data inside the Topic. If the data is not yet processed, it will be lost forever !

Finding old Topics

If you need to find out, if your Topic has unprocessed data, check the Consumers inside Kowl. If there is any with Lag, it still has unprocessed data.

Using Kowl for inspecting messages

Instructions

Allowing Kafka to delete Topics

By default Kafka is configured to not allow Topic deletion.

Therefore you need to execute the following steps first:

  1. Open your Cluster inside Lens

  2. Edit Kafka’s StatefulSet

    UMHLens_hOwAzfAGOO.png

  3. Search for KAFKA_CFG_DELETE_TOPIC_ENABLE and set it’s value to ‘true’

    UMHLens_qTZUb8lmX1.png

  4. Click “Save & Exit”

  5. On the Workloads → Pods page, you can see that Kafka is now restarting to load the new Config.

  6. After it has restarted you can go into Kowl and your mouse over a Topic.

  7. If will show you a Trashbin symbol, click it to delete a Topic

    Untitled

  8. After you confirmed deletion, there is no way to get any unprocessed Data back

    Untitled

  9. Kowl will also now show a success Message

  10. If the Topic comes back, you still have a producer and Kafka automatically re-created it.

Last modified February 17, 2023: update (#208) (ea731fc)