The most common issue cleaning up the cluster is that the rook-ceph namespace or the cluster CRD remain indefinitely in the terminating state. As already mentioned, a namespace cannot be removed until all of its resources are removed, so look at which resources (Pod, deployment, CRD, ecc.) are pending termination. For istance, if a Pod is still terminating, you will need to wait or else attempt to forcefully terminate it. 

It may happen that a cluster CRD still exists even though you have executed the delete command. This is because, when a Cluster CRD is created, a finalizer is added automatically by the Rook operator. The finalizer will allow the operator to ensure that before the cluster CRD is deleted, all block and file mounts will be cleaned up. Without proper cleanup, pods consuming the storage will be hung indefinitely until a system reboot. The operator is responsible for removing the finalizer after the mounts have been cleaned up. If for some reason the operator is not able to remove the finalizer, you can delete the finalizer manually with the following command

Removing the Cluster CRD Finalizer
# To view only the CRDs linked to Ceph
$ kubectl get crd -n rook-ceph | awk '/ceph.rook.io/ {print $1}'
# Insert the CRD in the placeholder below
$ kubectl get -n rook-ceph <CRD> -o name | xargs -I {} kubectl patch {} --type merge -p '{"metadata":{"finalizers": [null]}}'
  • No labels