PersistentVolumeClaim (PVC)
What is PersistentVolumeClaim (PVC)?
PersistentVolumeClaim (PVC): A Pod's request for storage — "I need 10Gi, ReadWriteOnce". Kubernetes binds it to a matching PV or provisions one dynamically. A PersistentVolumeClaim, or PVC, is a pod's request for storage, such as "10 GiB that one node can write to". Kubernetes matches it with an existing PersistentVolume or creates a new one through a StorageClass.
Frequently asked questions about PersistentVolumeClaim (PVC)
How is PersistentVolumeClaim (PVC) used in practice?
Pods refer to the claim by name and mount it as a folder. When a pod is replaced, the new pod mounts the same claim and finds the same data.
What should you keep in mind with PersistentVolumeClaim (PVC)?
Most cloud disks are ReadWriteOnce, which means only one node can mount them at a time. That is fine for a single database pod, but not for several web pods that all need to write uploads. For shared files, use object storage like S3 instead of a shared volume. Size claims with some margin, because growing them later is possible on many platforms but not all.
What does an example of PersistentVolumeClaim (PVC) look like?
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: data spec: accessModes: ["ReadWriteOnce"] resources: requests: { storage: 10Gi } At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |