Skip to content

6.1. PersistentVolumeClaims

Overview

The PersistentVolumeClaims page manages every PVC held on the MCM control plane in one place. A PVC (PersistentVolumeClaim) is the Kubernetes resource by which a user requests storage; it binds to a PersistentVolume and gives a pod persistent storage.

What it is for:

  • Managing multi-cluster PVCs together
  • Monitoring storage requests and their binding state
  • Managing storage classes and access modes
  • Distributing PVCs through a PropagationPolicy

Where PVCs are used:

  • Providing persistent storage for a database
  • Storage for file uploads
  • Storage for logs and backups
  • Keeping application state
  • A shared file system

How the Screen Is Laid Out

The PersistentVolumeClaims page shows the PVC list as a table.

The PVCs main screen

The Elements at the Top of the Page

ElementDescription
Namespace filterShows only the PVCs of a particular namespace
Include system namespacesToggles showing the PVCs of system namespaces (kube-system and so on)
Refresh buttonRefreshes the PVC list
Create buttonOpens the dialog for creating a new PVC
Search boxSearches by PVC name

Table Columns

ColumnDescriptionSortable
NameThe PVC name
NamespaceThe namespace the PVC belongs to
StatusThe PVC binding state (Bound/Pending/Lost)
VolumeThe name of the PersistentVolume it is bound to
CapacityThe storage capacity allocated
Access ModesThe volume access mode (RWO/RWX/ROX)
Storage ClassThe storage class used
AgeThe time since the PVC was created
ActionsThe edit and delete buttons-

How Status Is Shown

The Status column shows the PVC's binding state:

StatusDescriptionHow it is shown
BoundBound to a PersistentVolumeGreen
PendingWaiting for a suitable PVYellow
LostThe PV it was bound to has been deletedRed

Access Modes

Access modeDescription
RWOReadWriteOnce -- read and write from a single node
RWXReadWriteMany -- read and write from several nodes
ROXReadOnlyMany -- read-only from several nodes

PVC Detail

Clicking a PVC row opens the detail panel.

PVC detail

The Detail Panel Header

ElementDescription
PVC nameThe name of the chosen PVC
NamespaceThe namespace the PVC belongs to
StatusThe PVC binding state (Bound, for example)

The Action Buttons

ButtonWhat it does
RefreshRefreshes the PVC information
EditOpens the YAML edit mode
DeleteDeletes the PVC

The Tabs

The Overview Tab

Shows the PVC's basic information, storage information, and specification.

Basic information:

ItemDescription
NameThe PVC name
NamespaceThe namespace the PVC belongs to
StatusThe PVC binding state
AgeThe time since creation
CreatedWhen the PVC was created

Storage Information:

ItemDescription
VolumeThe name of the PersistentVolume it is bound to
CapacityThe storage capacity actually allocated
Access ModesThe volume access mode (RWO/RWX/ROX)
Storage ClassThe storage class used

Spec Information:

ItemDescription
Volume ModeFilesystem or Block
Requested StorageThe storage capacity requested

The Multi-Cluster Policies Tab

Shows the multi-cluster policies that apply to the PVC.

The multi-cluster policies tab

PropagationPolicy:

ColumnDescription
NameThe PropagationPolicy name
NamespaceThe namespace the policy belongs to
ScopeNamespace-scoped policies / cluster-scoped policies
Target ClustersThe list of target clusters

OverridePolicy:

Shown where there are per-cluster custom settings.

The Labels Tab

Shows the list of Kubernetes labels applied to the PVC.

The Annotations Tab

Shows the list of annotations applied to the PVC.

The Events Tab

Shows the Kubernetes events related to the PVC.

Creating a PVC

Creates a new PVC on the MCM control plane.

Fields

FieldRequiredDescription
NameThe PVC name
NamespaceThe namespace to deploy into
Storage Class-The storage class to use
Access ModesChoose the volume access mode
CapacityThe storage capacity to request

Example PVC Definitions

A basic PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard

A shared storage PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-pvc
namespace: default
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: nfs-client

A block volume PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: block-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
volumeMode: Block
resources:
requests:
storage: 5Gi
storageClassName: block-storage

Editing the YAML

The "Edit YAML" tab lets you write the PVC definition directly.

PVC Operations

Editing a PVC

  1. Choose the PVC
  2. Press the "Edit" button in the detail panel
  3. Change the PVC definition in the YAML editor
  4. Press the "Save" button

Caution: some PVC fields (the access mode, the storage class and so on) cannot be changed after creation.

Deleting a PVC

⚠️ Caution: deleting a PVC can lose data permanently. Whether the data is kept or deleted depends on the PV's reclaim policy.

  1. Choose the PVC to delete
  2. Press the "Delete" button in the detail panel
  3. Type the PVC name in the confirmation dialog
  4. Press the "Delete" button

Worked Examples

Scenario 1: Creating a PVC for a Database

  1. Press the "Create" button
  2. Enter the PVC details:
    • Name: postgres-data
    • Namespace: database
    • Storage Class: ssd-storage
    • Access Modes: ReadWriteOnce
    • Capacity: 20Gi
  3. Press the "Create" button
  4. Name the target clusters with a PropagationPolicy
  5. Mount the PVC in the database pod

Scenario 2: Creating a Shared File Storage PVC

  1. Press the "Create" button and choose the Edit YAML tab
  2. Write this YAML:
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: shared-files
    namespace: app
    spec:
    accessModes:
    - ReadWriteMany
    resources:
    requests:
    storage: 50Gi
    storageClassName: nfs-client
  3. Press the "Create" button
  4. Mount the same PVC in several pods

Scenario 3: Checking a PVC's Binding State

  1. Check the Status column in the PVC list
  2. Click a PVC in the "Pending" state
  3. Find why the binding failed on the Events tab:
    • No suitable PV
    • A problem with the storage class
    • Not enough capacity
  4. Take the action needed

Scenario 4: Deploying a PVC Across Clusters

  1. Create the PVC
  2. Create a PropagationPolicy:
    • Resource selector: name the PVC
    • Target clusters: choose the clusters to deploy to
  3. Check the "Multi-Cluster Policies" tab in the detail panel
  4. Check the PVC state on each cluster

Scenario 5: Monitoring Storage Capacity

  1. Check the Capacity column in the PVC list
  2. Check the storage information in the detail panel:
    • The requested capacity
    • The capacity actually allocated
    • The access mode
  3. Create a new PVC to grow it if needed

PVC against PV

TraitPVC (PersistentVolumeClaim)PV (PersistentVolume)
RoleRequests storageThe storage resource
Who creates itThe developer or userAn administrator or a dynamic provisioner
ScopeNamespace-scopedCluster-scoped
LifecycleIndependent of the podManaged by its binding to a PVC
PurposeRequesting application storageProviding the actual storage

Storage Classes

A storage class defines a kind of storage for dynamic provisioning:

KindDescriptionWhere it is used
standardThe default storageGeneral purpose
ssdSSD-backed storageHigh-performance databases
nfsA network file systemShared file storage
blockBlock storageHigh-performance I/O
archiveArchive storageBackups, log storage

Volume Modes

ModeDescriptionWhere it is used
FilesystemMounted as a file system (the default)Ordinary file storage
BlockMounted as a block deviceDatabases, high-performance workloads

The PV Reclaim Policy

Defines what happens to the PV when the PVC is deleted:

PolicyDescription
RetainKeeps the PV and its data (cleaning up is manual)
DeleteDeletes the PV and the storage automatically
RecycleDeletes the data and reuses the PV (deprecated)

Dynamic Provisioning

With a storage class, a PV is provisioned automatically when the PVC is created:

  1. The user creates a PVC (naming a storage class)
  2. The storage class's provisioner creates a PV
  3. The PVC and the PV bind automatically
  4. The pod can use the PVC

Managing Storage Across Clusters

When deploying a PVC to several clusters through MCM:

PropagationPolicy:

  • Copies the same PVC definition to several clusters
  • Each cluster binds its PV independently
  • Supports a different storage class per cluster

OverridePolicy:

  • Applies a different storage class per cluster
  • Adjusts the capacity per cluster
  • For example, SSD on cluster A and HDD on cluster B

Points to watch:

  • Check the storage classes available on each cluster
  • A PV is a cluster-local resource, so it cannot be shared between clusters
  • Data replication has to be handled at the application level

Resolving Problems

When a PVC stays Pending:

  • Check the storage class exists
  • Check the provisioner is working
  • Check the requested access mode is supported
  • Check there is enough storage capacity

When a PVC is Lost:

  • Check whether the PV it was bound to has been deleted
  • Check the state of the storage backend
  • Judge whether the data needs recovering
  • Consider creating a new PVC

When a pod fails to mount a PVC:

  • Check the PVC is Bound
  • Check the access mode matches what the pod needs
  • Check the storage is reachable from the node
  • Check the volume mode is right

Next Steps