Add a script to log the leftover omap and subvolume/rbd image
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 617
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 43
Description
When a PVC with `reclaimPolicy:retain` is deleted from the kubernetes cluster. the PV, OMAP data corresponding to the PVC and also the backend subvolume or rbd image need to be deleted to reclaim the space in the ceph cluster.
We need to add a script to list the all PVC, subvolume, rbd images (not we need to list the rbd images and subvolumes need to be cleanup)
Note: one Gotha here is that maybe rbd image or subvolume might be used by other remote kubernetes clusters.
Scenarios we need to document and the script is
# PVC with reclaimPolicy:retain
## When PV is not deleted
We can fetch the details from the PV and print out the omap and rbd image/subvolume name
## When PV is already deleted
This is kind of tricky as from outside we can list all the unused rbd images /subvolume and omap keys ( its admin responsibility to cleck that resource is not used anywhere else and delete it)
# snapshot with reclaimPolicy:retain
## When `volume snapshot content` is not deleted
We can fetch the details from the PV and print out the omap and rbd image/subvolume name
## When `volume snapshot content` is already deleted
This is kind of tricky as from outside we can list all the unused rbd images /subvolume and omap keys ( its user responsibility to cleck that resource is not used anywhere else and delete it)
we already have a script to list the resources based on the PVC we need to enhance it for below things
* List backend data based on the PV object ( not we also need to disable backend omap key and rbd image/subvolume/snapshot name
* List backend data whose corresponding PV object is not present
we may also need to document/ or provide one more option to run ceph command when users are not running ceph cluster using rook(current scripts uses toolbox pod)
@humblec @ShyamsundarR @nixpanic please add if am missing any scenario.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the existing script that lists resources based on a PVC and trace how it obtains PV and backend details. Compare the retained-PV and deleted-PV scenarios, including snapshots, and define output for backend objects without Kubernetes counterparts. Done means the script covers these cases and documents how to run Ceph commands without a Rook toolbox.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- devops, infrastructure, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100