Delete a Pulsar Cluster
note
The termination policy determines how a cluster is deleted.
Termination policy
terminationPolicy | Deleting Operation |
---|---|
DoNotTerminate | DoNotTerminate prevents deletion of the Cluster. This policy ensures that all resources remain intact. |
Delete | Delete deletes Cluster resources like Pods, Services, and Persistent Volume Claims (PVCs), leading to a thorough cleanup while removing all persistent data. |
WipeOut | WipeOut is an aggressive policy that deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, primarily in non-production environments to avoid irreversible data loss. |
To check the termination policy, execute the following command.
- kubectl
- kbcli
kubectl -n demo get cluster mycluster
>
NAME CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS AGE
mycluster pulsar pulsar-3.0.2 Delete Running 19m
kbcli cluster list mycluster -n demo
>
NAME NAMESPACE CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS CREATED-TIME
mycluster demo pulsar pulsar-3.0.2 Delete Running Sep 28,2024 16:47 UTC+0800
Step
Run the command below to delete a specified cluster.
- kubectl
- kbcli
kubectl delete cluster mycluster -n demo
If you want to delete a cluster and its all related resources, you can modify the termination policy to WipeOut
, and 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 -n demo