Where can I find the directories and files stored on my host(s) by OpenEBS?

686 Views Asked by At

I have installed OpenEBS with replica count 3 in a 3-node k8s cluster. I need to find where the files are being stored.

2

There are 2 best solutions below

1
On BEST ANSWER

The location of the data depends on the type of the OpenEBS Volume. The device location/path can be determined by querying the storage pool information. It is either hostPath (for jiva volumes) or a device path (for cstor volumes).

OpenEBS Jiva Volumes: The path can be also obtained by describing the replica pod/deployment.

kubectl get deployment <volumename-name>-rep -n <pvc-namespace> -o yaml

OpenEBS cStor Volumes: The path depends on the disks used by the Storage Pool. Find the disks associated with the cStor Storage Pool and then get the device information by obtaining the details on the "disk" object. Commands to be used:

kubectl get storageclass <pvc-storage-class> -o yaml
#get the storage pool claim name 
kubectl get storagepool <storage-pool-claim-name>-<uid> -o yaml
#get disk name under disk list
kubectl get disk <disk-name> -o yaml
0
On

A generic solution relying on the folder name containing both openebs and a pvc:

$ cd / && sudo find | grep "openebs.*pvc"

You can also pinpoint a particular PVC (given its name obtained from the VOLUME column of the kubectl get pvc command output) by adding | grep <PVC_NAME>):

$ cd / && sudo find | grep "openebs.*pvc-be410650-00af-4c89-afa6-e19c48426356"

Sample output:

./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.local
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.local/share
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.local/share/jupyter
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.local/share/jupyter/nbextensions
[..]
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.jupyter
./var/snap/microk8s/common/var/openebs/local/pvc-be410650-00af-4c89-afa6-e19c48426356/.jupyter/jupyter_notebook_config.py