// Module included in the following assemblies:
//
// assembly-using-the-topic-operator.adoc

[id='deleting-a-topic-{context}']
= Deleting a topic

This procedure describes how to delete a Kafka topic using a `KafkaTopic` Kubernetes resource.

.Prerequisites

* A running Kafka cluster.
* A running Topic Operator (typically xref:assembly-kafka-entity-operator-deployment-configuration-kafka[deployed with the Entity Operator]).
* An existing `KafkaTopic` to be deleted.
* `delete.topic.enable=true` (default)

NOTE: The `delete.topic.enable` property must be set to `true` in `Kafka.spec.kafka.config`. Otherwise, the steps outlined here will delete the `KafkaTopic` resource, but the Kafka topic and its data will remain. After reconciliation by the Topic Operator, the custom resource is then recreated.

.Procedure

* Delete the `KafkaTopic` resource in Kubernetes.
+
This can be done using `kubectl delete`:
+
[source,shell,subs=+quotes]
kubectl delete kafkatopic _your-topic-name_

.Additional resources
* For more information about deploying a Kafka cluster using the Cluster Operator, see xref:cluster-operator-str[Deploying the Cluster Operator].
* For more information about deploying the Topic Operator using the Cluster Operator, see xref:deploying-the-topic-operator-using-the-cluster-operator-str[Deploying the Topic Operator using the Cluster Operator].
* For more information about creating a topic using the Topic Operator, see xref:creating-a-topic-str[Creating a Topic].
