How do PV and PVC relate?

097

PersistentVolume (PV) and PersistentVolumeClaim (PVC) relate to each other in Kubernetes through a binding process that allows users to request and utilize persistent storage. Here’s how they are connected:

1. Purpose

  • PV: Represents a piece of storage in the cluster that has been provisioned by an administrator or dynamically created. It defines the storage capacity, access modes, and other attributes.
  • PVC: A request for storage by a user or application. It specifies the desired storage size and access modes.

2. Binding Process

  • When a PVC is created, Kubernetes looks for a PV that meets the requirements specified in the PVC (such as storage size and access modes).
  • If a matching PV is found, Kubernetes binds the PVC to that PV. This binding reserves the storage for the PVC.

3. Accessing Storage

  • Once the PVC is bound to a PV, the PVC can be referenced in Pod specifications. This allows Pods to mount the persistent storage provided by the PV.
  • The data stored in the PV remains available even if the Pods using it are deleted or restarted.

4. Lifecycle

  • The lifecycle of a PV is independent of the Pods that use it. A PV can exist without being bound to a PVC, but once a PVC is bound to a PV, the PV cannot be bound to another PVC until it is released.

Summary

  • PV provides the actual storage resource.
  • PVC is a request for that storage.
  • The binding of PVC to PV allows Pods to access persistent storage, ensuring data persistence beyond the lifecycle of individual Pods.

0 Comments

no data
Be the first to share your comment!