一个永久卷是否可以被多个永久卷声明消耗掉? [英] Can one persistent volume by consumed by several persistent volume claims?

查看:102
本文介绍了一个永久卷是否可以被多个永久卷声明消耗掉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设一个PV可以被多个PVC消耗并且每个Pod实例需要一个PVC绑定是正确的吗?我之所以问是因为我先创建了PV,然后创建了PVC,其尺寸要求不同,例如:

Is it correct to assume that one PV can be consumed by several PVCs and each pod instance needs one binding of PVC? I'm asking because I created a PV and then a PVC with different size requirements such as:

kind: PersistentVolume
apiVersion: v1
metadata:
  name: k8sdisk
  labels:
    type: amazonEBS
spec:
  capacity:
    storage: 200Gi
  accessModes:
    - ReadWriteOnce
  awsElasticBlockStore:
    volumeID: vol-xxxxxx
    fsType: ext4


kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: couchbase-pvc
  labels:
    type: amazonEBS
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi

但是当我将PVC与Pod一起使用时,它显示为200GB可用空间,而不是5GB.

But when I use the PVC with the pod, it shows as 200GB available instead of the 5GB.

我确定我正在混合各种东西,但是找不到合理的解释.

I'm sure I'm mixing things, but could not find a reasonable explanation.

推荐答案

拥有PVC时,它将寻找满足其要求的PV,但除非它是卷并且在多路访问模式下声明所有权(并且在那里是支持它的有限数量的后端,例如NFS- http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes ),PV将不会被多个PVC共享.此外,PVC的大小并不是为了限制Pod生命周期内保存在卷上的数据量的配额,而是作为匹配足够大PV的一种方式.

When you have a PVC it will look for a PV that will satisfy it's requirements, but unless it is a volume and claim in multi-access mode (and there is a limited amount of backends that support it, like ie. NFS - details in http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes), the PV will not be shared by multiple PVC. Furthermore, the size in PVC is not intended as quota for the amount of data saved on the volume during pods life, but as a way to match big enough PV, and thats it.

这篇关于一个永久卷是否可以被多个永久卷声明消耗掉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆