Deleting Instance

Deleting an instance will remove not only the created CR resources but also the StatefulSets, ConfigMaps, Secrets, PersistentVolumeClaims, and other resources created by Operator based on the CR resources.

TOC

Procedure

CLI
Web Console

If the instance does not have persistence enabled, or if you need to keep the persistent data of the instance, execute the following command to delete the instance:

# delete redis instance directly
$ kubectl -n default delete redis <Instance Name>

If you want to delete the instance and also remove its persistent volume claim, you can execute the following commands:

# patch finalizer `delete-pvc` to instance
$ kubectl -n default patch redis <Instance Name> --type='merge' -p '{"metadata": {"finalizers": ["delete-pvc"]}}'

# delete redis instance with pvc
$ kubectl -n default delete redis <Instance Name>

delete-pvc is a built-in keyword in the Operator, used to instruct the operator to delete the persistent volume storage when deleting the instance.