What is the difference between persistent volume (PV) and persistent volume claim (PVC) in simple terms?

后端 未结 10 1703
我在风中等你
我在风中等你 2021-01-30 19:22

What is the difference between persistent volume (PV) and persistent volume claim (PVC) in Kubernetes/ Openshift by referring to documentation?

What is the difference be

相关标签:
10条回答
  • 2021-01-30 20:11

    PersistentVolume(PV) and PersistentVolumeClaim(PVC) are the resources APIs provided by the Kubernetes. PV is a piece of storage which supposed to preallocated by an admin. And PVC is a request for a piece of storage by a user.

    0 讨论(0)
  • PV is a logical representation of storage attached to a Pod or a Deployment. It uses PVC to request storage resource from the physical storage resources in your Kube Cluster. In my opinion its relationship is more like:

    Pods -> PV -> PVC -> Physical Storage

    Many explanations online sounds confusing and I understand this from their relationship in manifest files.

    0 讨论(0)
  • 2021-01-30 20:15

    Short and Simple

    Persistent Volume - Available storage let's say you have 100Gi

    Persistent Volume Claim - You request from Persistent Volume, let's say you request 10Gi you'll get it but if you request 110Gi you won't get it.

    0 讨论(0)
  • 2021-01-30 20:15

    You can find some common when comparing PV and PVC with node and pods. PV like a node, which defines the storage. PVC like pods that requires the resources (Mem, CPU) and get them in case the node has the resources to allocate, which in this case it's a storage.

    0 讨论(0)
  • 2021-01-30 20:16

    Short:
    - Here you have the storage! PersistenVolume (PV)
    - You get the storage if you really need it! PersistentVolumeClaim (PVC)

    0 讨论(0)
  • 2021-01-30 20:16

    A Persistent Volume Claim is telling you what options you have access to in a particular cluster and they got this circular at this store called Smart Tech with some ads about your configuration options, those ads are the Persistent Volume Claim.

    Inside your config file you write out the different Persistent Volume Claims that you are going to have inside your cluster, kind of like your wish list to Santa, but of course you are going to go take that to the sales guy at Smart Tech when you are done.

    So you write a config file that says there should a 600gb hard drive option available to all your clusters and a 1TB hard drive option as well.

    When you choose one of these options of the Persistent Volume Claim you go and request that Kubernetes (the sales guy) goes and gets that option for you, the option you have chosen, Kubernetes has to look through these instances of storage options in the stock room that are readily available. These instances of hard drives can be used right away and they are considered statically provisioned because they are created ahead of time.

    On the other hand, there is dynamically provisioned options that were created on the fly, when you asked Kubernetes the sales guy, so kind of like just-in-time production, it got created when you immediately asked for it.

    So the Persistent Volume Claim is the stores advertisement of options and whichever one you choose Kubernetes will go get it, either one in storage or create one on the fly.

    The Persistent Volume is the actual product or options that you get back from Kubernetes that you asked for. If Kubernetes does not have what you asked for it will try to create it on the fly for you.

    So the PVC is what Smart Tech is advertising they have to offer to your cluster which Kubernetes the sales guy will get for you and the PV is the actual finished product delivered to you.

    0 讨论(0)
提交回复
热议问题