If you need to delete a rook-ceph cluster and redeploy a new one, you should follow this document to sequentially clean the distributed storage service related resources.
Before cleaning up rook-ceph, ensure that all PVC and PV resources using Ceph storage have been deleted.
Delete the VolumeSnapshotClasses.
Verify that the VolumeSnapshotClasses have been cleaned up.
When there is no output from these commands, it indicates that the cleanup is complete.
Go to Platform Management.
In the left navigation bar, click Storage Management > Storage Classes.
Click ⋮ > Delete, and delete all StorageClasses that use Ceph storage solutions.
This step should be performed after the previous step has been completed.
Go to Platform Management.
In the left navigation bar, click Storage Management > Distributed Storage.
In the Storage Pool Area, click ⋮ > Delete, and delete all storage pools one by one. When the storage pool area shows No Storage Pools, it indicates successful deletion of the storage pools.
(Optional) If the cluster mode is Extended, you also need to execute the following command on the Master node of the cluster to delete the created built-in storage pools.
Response:
This step should be performed after the previous step has been completed.
Update the ceph-cluster and enable the cleanup policy.
Delete the ceph-cluster.
Delete the jobs that perform the cleanup.
Verify that the ceph-cluster cleanup is complete.
When this command has no output, it indicates that the cleanup is complete.
This step should be performed after the previous step has been completed.
Delete the rook-operator.
Verify that the rook-operator cleanup is complete.
When this command has no output, it indicates that the cleanup is complete.
Verify that all ConfigMaps have been cleaned up.
When this command has no output, it indicates that cleanup is complete. If there are output results, execute the following command to clean up, replacing <configmap>
with the actual output.
Verify that all Secrets have been cleaned up.
When this command has no output, it indicates that cleanup is complete. If there are output results, execute the following command to clean up, replacing <secret>
with the actual output.
Verify that the rook-ceph cleanup is complete.
When this command has no output, it indicates that cleanup is complete.
Once the above steps are completed, it indicates that Kubernetes and Ceph related resources have been cleared. Next, you need to clean up any residuals of rook-ceph on the host.
The contents of the cleanup script clean-rook.sh are as follows:
The cleanup script depends on the sgdisk command, so please make sure to have it installed before executing the cleanup script.
sudo apt install gdisk
sudo yum install gdisk
Execute the cleanup script clean-rook.sh on each machine in the business cluster where distributed storage is deployed.
Example: sh clean-rook.sh /dev/vdb
When executed, you will be prompted to confirm whether to really clear the device. If confirmed, enter yes to begin cleaning.
Use the lsblk -f
command to check the partition information. When the FSTYPE
column in the output of this command is empty, it indicates that the cleanup is complete.