KubeBlocks
BlogsKubeBlocks Cloud
⌘K
​
KubeBlocks for Kafka

Cluster Management

Create
Connect
Scale
Expand volume
Restart
Stop/Start
Delete protection

Configuration

Configure cluster parameters
Resource description
  1. Termination policy
  2. Steps

Delete a Kafka cluster

Termination policy

NOTE

The termination policy determines how a cluster is deleted. Set the policy when creating a cluster.

terminationPolicyDeleting Operation
DoNotTerminateDoNotTerminate blocks delete operation.
HaltHalt deletes Cluster resources like Pods and Services but retains Persistent Volume Claims (PVCs), allowing for data preservation while stopping other operations. Halt policy is deprecated in v0.9.1 and will have same meaning as DoNotTerminate.
DeleteDelete extends the Halt policy by also removing PVCs, leading to a thorough cleanup while removing all persistent data.
WipeOutWipeOut deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, especially in non-production environments, to avoid irreversible data loss.

To check the termination policy, execute the following command.

kubectl -n demo get cluster mycluster
>
NAME           CLUSTER-DEFINITION   VERSION        TERMINATION-POLICY   STATUS     AGE
mycluster      kafka                kafka-3.3.2    Delete               Running    19m
kbcli cluster list mycluster -n demo
>
NAME        NAMESPACE   CLUSTER-DEFINITION   VERSION       TERMINATION-POLICY   STATUS    CREATED-TIME
mycluster   demo        kafka                kafka-3.3.2   Delete               Running   Sep 27,2024 15:15 UTC+0800

Steps

Run the command below to delete a specified cluster.

kubectl delete -n demo cluster mycluster

If you want to delete a cluster and its all related resources, you can set the termination policy to WipeOut, then delete the cluster.

kubectl patch -n demo cluster mycluster -p '{"spec":{"terminationPolicy":"WipeOut"}}' --type="merge"

kubectl delete -n demo cluster mycluster
kbcli cluster delete mycluster

© 2025 ApeCloud PTE. Ltd.