Persistent Volumes 和 Persistent Volume Claims 之间的关系是什么(1:1 或 1:n)

What is the relationship between Persistent Volumes and Persistent Volume Claims (1:1 or 1:n)

我目前正在为我的家庭服务器中需要持久存储的一些服务编写清单。我想使用 PV 和 PVC。我是否创建一个单一的大 PV 并在所有服务中共享它?还是 PVC 和 PV 之间存在 1:1 关系?

我不是在问 PV 和 PVC 之间的区别。这已经在 Stack Overflow 上得到了回答。例如 .

这是一对一的关系。

您的环境中可以有多个 PV。特定 PVC 是符合您要求的条件的特定实例的 声明 ,例如大小和类型。只要您的 PVC 资源存在于您的集群中,该卷就会被声明并保留您的数据,但如果您删除您的 PVC,数据可能会丢失。

来自documentation

Once bound, PersistentVolumeClaim binds are exclusive, regardless of how they were bound. A PVC to PV binding is a one-to-one mapping, using a ClaimRef which is a bi-directional binding between the PersistentVolume and the PersistentVolumeClaim.