// 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` {ProductPlatformName} resource.

.Prerequisites

* A running Kafka cluster.
* A running Topic Operator.
* An existing `KafkaTopic` to be deleted.

.Procedure

. Delete the `KafkaTopic` resource in {ProductPlatformName}.
+
ifdef::Kubernetes[]
On {KubernetesName} this can be done using `kubectl`:
+
[source,shell,subs=+quotes]
kubectl delete kafkatopic _your-topic-name_
+
endif::Kubernetes[]
On {OpenShiftName} this can be done using `oc`:
+
[source,shell,subs=+quotes]
oc delete kafkatopic _your-topic-name_
+
NOTE: Whether the topic can actually be deleted depends on the value of the `delete.topic.enable` Kafka broker configuration, specified in the `Kafka.spec.kafka.config` property.

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