Inferensys

Glossary

Persistent Volume Claim (PVC)

A Persistent Volume Claim (PVC) is a Kubernetes API object that allows users to request specific storage resources (like size and access modes) from the cluster, which are then dynamically or statically provisioned by binding to a Persistent Volume (PV).
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
KUBERNETES STORAGE

What is Persistent Volume Claim (PVC)?

A Persistent Volume Claim (PVC) is a Kubernetes storage abstraction that allows users to request storage resources without needing to know the details of the underlying storage infrastructure.

A Persistent Volume Claim (PVC) is a user's request for a specific amount and type of persistent storage in a Kubernetes cluster. It acts as a declarative interface, where a pod specifies its storage needs (e.g., size, access mode), and the Kubernetes control plane dynamically binds the PVC to an available Persistent Volume (PV) that matches the requirements. This abstraction decouples storage configuration from pod specifications, enabling portability and dynamic provisioning.

In the context of agent deployment observability, PVCs are critical for stateful agents that require durable storage for logs, telemetry data, session states, or model caches. By binding to a PV—which could be backed by cloud block storage, network-attached storage (NAS), or local volumes—a PVC ensures that an agent's critical data persists across pod restarts, rescheduling, and rolling updates, maintaining operational continuity and enabling forensic analysis of agent behavior.

KUBERNETES STORAGE ABSTRACTION

Key Features of Persistent Volume Claims

A PersistentVolumeClaim (PVC) is a user's request for storage, which is fulfilled by binding to a PersistentVolume (PV) that provides the actual storage resources in a Kubernetes cluster. These features define how PVCs abstract storage complexity for applications.

01

Dynamic Provisioning

A PVC can automatically trigger the creation of a new PersistentVolume (PV) on-demand. When a PVC specifies a StorageClass, the cluster's provisioner creates the underlying storage resource (e.g., an AWS EBS volume or Azure Disk) and a corresponding PV object, which is then bound to the PVC. This eliminates the need for administrators to pre-provision PVs manually.

  • Example: A PVC with storageClassName: fast-ssd causes the cloud provider's CSI driver to create a new SSD-based volume.
  • Key Benefit: Enables self-service storage for developers and automated scaling.
02

Access Modes

A PVC specifies how the mounted storage can be accessed by pods. Kubernetes supports three primary modes:

  • ReadWriteOnce (RWO): The volume can be mounted as read-write by a single node. This is common for block storage.
  • ReadOnlyMany (ROX): The volume can be mounted as read-only by many nodes simultaneously.
  • ReadWriteMany (RWX): The volume can be mounted as read-write by many nodes. This is typically provided by file or object storage (e.g., NFS, CephFS).

The PVC's request is matched against PVs that support the required mode, ensuring compatibility with the application's data sharing needs.

03

Storage Class Selection

The StorageClass resource defines a class of storage (e.g., performance tier, availability zone, backup policy). A PVC references a StorageClass by name to request storage with those specific qualities.

  • Parameters: A StorageClass contains parameters passed to the provisioner, like type: gp3 or replication: "3".
  • Default Class: A cluster can have a default StorageClass; PVCs without a specified class will use it.
  • Binding Mode: Determines when volume binding occurs (Immediate vs. WaitForFirstConsumer), which is critical for topology-aware scheduling (e.g., ensuring a pod's volume is created in the same cloud availability zone as the pod).
04

Resource Requests & Limits

A PVC defines the quantity of storage required using standard Kubernetes resource syntax.

  • Request (spec.resources.requests.storage): The minimum amount of storage the PVC needs (e.g., 10Gi). This is the primary matching criterion for PV binding.
  • Expansion: Many storage drivers support volume expansion. A PVC's request can be increased post-creation if its StorageClass has allowVolumeExpansion: true. The underlying volume is resized, and the file system typically needs expansion within the pod.
  • Limits: While not directly specified in the PVC, ResourceQuotas at the namespace level can limit the total amount of storage a team can claim via PVCs.
05

Lifecycle & Reclaim Policy

The lifecycle of a PVC and its bound PV is governed by reclaim policies set on the PV.

  • Retain: When the PVC is deleted, the PV is not deleted. It enters a Released state, preserving its data. An administrator must manually clean it up before it can be reused.
  • Delete: The default for dynamically provisioned volumes. Deleting the PVC triggers the deletion of the associated PV and the underlying storage asset in the cloud or infrastructure.
  • Recycle (Deprecated): A basic data scrubbing policy, now replaced by dynamic provisioning. This policy is crucial for data safety, preventing accidental loss of persistent data when claims are removed.
06

Binding & Volume Mode

The interaction between a PVC and a PV involves specific binding rules and data presentation formats.

  • Static Binding: A pre-existing PV is matched to a PVC based on storage size, access modes, StorageClass, and other labels. The closest match is selected.
  • Dynamic Binding: As described in Dynamic Provisioning.
  • Volume Mode: Specifies whether the volume is presented as a filesystem (Filesystem) or a raw block device (Block) to the pod. Block mode is used for performance-sensitive applications like databases that manage their own file systems.
  • Selector: A PVC can use selector to request a PV with specific labels, enabling fine-grained control over which pre-provisioned volume it binds to.
KUBERNETES STORAGE ABSTRACTION

PVC vs. Persistent Volume (PV): Key Differences

A comparison of the user-facing storage request object (Persistent Volume Claim) and the cluster resource representing actual storage (Persistent Volume).

FeaturePersistent Volume Claim (PVC)Persistent Volume (PV)

Primary Purpose

User request for storage

Cluster resource representing storage

Kubernetes API Object

Defined By

Developer / Application Manifest

Cluster Administrator / Storage Provisioner

Binding Direction

Requests and binds to a PV

Is bound by a matching PVC

Dynamic Provisioning Trigger

true (via StorageClass)

Created automatically when triggered by a PVC

Static Provisioning Use Case

Binds to a pre-existing, administrator-created PV

Pre-created by an administrator for manual assignment

Lifecycle Tied To

Pod / Namespace (typically deleted with the app)

Cluster (persists until explicitly deleted)

Access Modes Specified

true (e.g., ReadWriteOnce, ReadOnlyMany)

true (Defines what modes the actual storage supports)

Storage Capacity Request

true (e.g., '10Gi')

true (Defines the actual capacity of the volume)

StorageClass Reference

true (Specifies the type of storage desired)

May have a StorageClass annotation (identifies its provisioner)

Namespace Scope

true (Bound to a specific namespace)

false (Cluster-scoped resource)

Status Field Indicates

'Pending', 'Bound', 'Lost'

'Available', 'Bound', 'Released', 'Failed'

Common Use in Agent Observability

Mounting for agent session logs, trace data, or model checkpoints

Providing the underlying NFS, cloud disk, or CSI volume for that data

KUBERNETES STORAGE

Common Use Cases for Persistent Volume Claims

Persistent Volume Claims (PVCs) are the primary interface for workloads to request and consume storage in Kubernetes. These are the most common scenarios where PVCs are essential for reliable, stateful operations.

01

Stateful Application Databases

PVCs provide the durable storage backend for databases like PostgreSQL, MySQL, and MongoDB running in Kubernetes. The PVC ensures that critical data persists independently of the pod's lifecycle, preventing data loss during pod rescheduling, node failures, or rolling updates. This is a fundamental requirement for any production database deployment.

  • Example: A StatefulSet for PostgreSQL creates a unique PVC for each pod replica, guaranteeing stable network identity and persistent storage.
02

Message Queue and Streaming Data

Message brokers (e.g., Apache Kafka, RabbitMQ) and streaming platforms require persistent storage for message durability and log retention. PVCs are bound to these pods to store message queues, topic partitions, and consumer offsets. This ensures that in-flight messages and stream history are not lost if a broker pod is restarted or moved.

  • Critical for: Guaranteeing at-least-once or exactly-once delivery semantics in event-driven architectures.
03

Centralized Logging and Monitoring

Observability stacks like the Elasticsearch, Logstash, and Kibana (ELK) or Grafana Loki rely on PVCs for long-term metric and log storage. The central log aggregator (e.g., Elasticsearch) uses PVCs to maintain its indices, allowing historical data analysis and trend visualization. Without PVCs, this data would be ephemeral and lost on pod eviction.

  • Typical setup: A dedicated storage class with high IOPS for fast log ingestion and query performance.
04

Content Management and File Servers

Applications that serve user-generated content—such as document management systems, media libraries, or web content managers—use PVCs as mounted file systems. The PVC acts as a network-attached directory where uploaded files, images, and assets are stored. This allows multiple application pod replicas to share access to the same set of files.

  • Access Modes: Typically use ReadWriteMany (RWX) access mode if supported by the storage provider to allow concurrent writes from multiple pods.
05

Machine Learning Training Data and Model Artifacts

In ML pipelines, PVCs are used to store large training datasets, pre-trained model weights, and experiment artifacts. Training jobs can mount the same PVC to access shared data, and upon completion, persist the trained model to the PVC for serving. This decouples the expensive compute (training pods) from the storage layer.

  • Workflow: 1. Data preparation pod writes processed dataset to PVC. 2. Training pod mounts PVC, reads data, writes model. 3. Inference service pod mounts the same PVC to load the model.
06

CI/CD Pipeline Workspaces

Continuous Integration/Continuous Deployment systems (e.g., Jenkins, Tekton, GitLab Runner) use PVCs to provide workspace persistence across pipeline stages. This allows build artifacts, dependency caches (like Maven or npm), and test results to be shared between sequential steps (e.g., build, test, package) without re-downloading or rebuilding.

  • Performance Benefit: Caching dependencies in a PVC can dramatically reduce pipeline execution time and network egress costs.
KUBERNETES STORAGE

Frequently Asked Questions

A Persistent Volume Claim (PVC) is a fundamental Kubernetes storage abstraction. These questions address its core function, lifecycle, and role in deploying stateful, observable agent systems.

A Persistent Volume Claim (PVC) is a Kubernetes object that represents a user's request for a specific amount and type of persistent storage. It functions as an abstraction layer, decoupling the storage requirements of an application (the claim) from the underlying storage infrastructure (the provision).

Here is the standard workflow:

  1. A developer defines a PVC manifest, specifying requirements like storage capacity, access modes (e.g., ReadWriteOnce), and optionally a storage class.
  2. Upon creation, the Kubernetes control plane searches for a suitable Persistent Volume (PV)—a piece of pre-provisioned or dynamically provisioned network storage—that matches the claim's requirements.
  3. If a match is found, the PVC is bound to that PV. This binding is exclusive; the PV cannot be claimed by another PVC.
  4. The bound PVC can then be mounted into a Pod as a volume, providing the container(s) with persistent, filesystem-like storage that survives pod restarts and rescheduling.

This mechanism is critical for agent deployment observability, as it allows telemetry data, logs, and agent state to be durably stored across pod lifecycles, enabling continuous monitoring and audit trails.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.