The mapping in Kubernetes is the following:

PVC

kubectl get pv 获取所有的pv

rbd ls kubernetes 查看所有 k8s在ceph里面申请的块

你会 发现,两边名字对应不上。怎么查找关系呢?

kubectl get pv pvc-c409bdcb-6cea-11e9-8936-9600001d3fab -o yaml

apiVersion: v1

kind: PersistentVolume

metadata:

annotations:

pv.kubernetes.io/provisioned-by: ceph.rook.io/block

creationTimestamp: "2019-05-02T14:58:38Z"

finalizers:

- kubernetes.io/pv-protection

name: pvc-c409bdcb-6cea-11e9-8936-9600001d3fab

resourceVersion: "10504117"

selfLink: /api/v1/persistentvolumes/pvc-c409bdcb-6cea-11e9-8936-9600001d3fab

uid: c453d6f5-6cea-11e9-a067-9600001d3fa9

spec:

accessModes:

- ReadWriteOnce

capacity:

storage: 150Gi

claimRef:

apiVersion: v1

kind: PersistentVolumeClaim

name: REDACTED

namespace: REDACTED

resourceVersion: "10504100"

uid: c409bdcb-6cea-11e9-8936-9600001d3fab

flexVolume:

driver: ceph.rook.io/rook-ceph-system

fsType: xfs

options:

clusterNamespace: rook-ceph

dataBlockPool: ""

image: pvc-c409bdcb-6cea-11e9-8936-9600001d3fab

pool: block-repl-3-1

storageClass: rook-ceph-block-repl-3-1

persistentVolumeReclaimPolicy: Delete

storageClassName: rook-ceph-block-repl-3-1

volumeMode: Filesystem

status:

phase: Bound

通过 kubectl get pv pvc-c409bdcb-6cea-11e9-8936-9600001d3fab -o yaml 命令查询pv的详细信息,里面能看到挂载的那个ceph块。

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐