kubernetes 我在哪里可以找到OpenEBS存储在我的主机上的目录和文件?

m528fe3b  于 2023-08-03  发布在  Kubernetes
关注(0)|答案(2)|浏览(277)

我已经在一个3节点k8s集群中安装了副本数为3的OpenEBS。我需要找到文件存放在哪里。

o0lyfsai

o0lyfsai1#

数据的位置取决于OpenEBS卷的类型。可以通过查询存储池信息来确定设备位置/路径。它可以是hostPath(对于jiva卷)或设备路径(对于cstor卷)。
OpenEBS Jiva卷:也可以通过描述复制副本单元/部署来获取路径。

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

字符串
OpenEBS cStor卷:路径取决于存储池使用的磁盘。找到与cStor存储池关联的磁盘,然后通过获取“disk”对象的详细信息来获取设备信息。要使用的命令:

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

t40tm48m

t40tm48m2#

一种通用解决方案,它依赖于同时包含openebspvc的文件夹名:

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

字符串
您还可以通过添加| grep <PVC_NAME>来确定特定PVC(给定其名称从kubectl get pvc命令输出的VOLUME列获得):

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


样品输出:

./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

相关问题