DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Kubernetes Tutorial

Introduction to Kubernetes
Kubernetes Architecture
Installing Kubernetes
kubectl Basics
Kubernetes Pods
Kubernetes Deployments
Kubernetes Services
ConfigMaps and Secrets
Kubernetes Storage
Kubernetes Namespaces
Kubernetes Resource Management
Helm for Kubernetes
Kubernetes Monitoring

Persistent Volumes and PersistentVolumeClaims

PreviousPrev
Next

Understand the PV and PVC model, access modes, reclaim policies, and how a pod mounts durable storage through a claim.

PV and PVC in Plain English

A PersistentVolume (PV) is storage available to the cluster. A PersistentVolumeClaim (PVC) is a request for some of that storage from within a namespace.

Scope Difference

ResourceScope
PVCluster-level
PVCNamespace-level

Binding Lifecycle

StateMeaning
AvailablePV exists and is not yet claimed
BoundPVC is attached to a PV
ReleasedClaim was removed but PV handling is not finished
FailedBinding or reclaim operation failed

Access Modes

ModeMeaning
RWOReadWriteOnce
ROXReadOnlyMany
RWXReadWriteMany

Reclaim Policies

PolicyEffect
RetainKeep storage for manual cleanup or reuse
DeleteRemove underlying storage when released
RecycleLegacy pattern, rarely used now

Full YAML Example

apiVersion: v1
kind: PersistentVolume
metadata:
  name: demo-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /data/demo-pv
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: demo-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: pvc-demo
spec:
  containers:
    - name: app
      image: busybox:1.36
      command: ['sh', '-c', 'echo hello > /data/hello.txt && sleep 3600']
      volumeMounts:
        - name: data
          mountPath: /data
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: demo-pvc

Binding Diagram

Pod → PVC → PV → Storage backend

Pod

mounts /data

PVC

claim · namespace

requests: 10Gi RWO

binds to

PV

cluster-wide resource

capacity: 50Gi

Storage

AWS EBS / GCP PD

NFS / hostPath

AvailableBoundReleasedFailed

PV lifecycle phases

Why PVCs Are Better for App Teams

Developers usually should not hardcode infrastructure details. A PVC lets them ask for storage by size and capabilities, while platform teams manage the backing implementation.

Exercise

Scope Check

Which statement about scope is correct?

Exercise

Retain Policy

What does the `Retain` reclaim policy generally mean?

PreviousPrev
Next

Continue Learning

Kubernetes ConfigMaps

Create ConfigMaps from literals, files, or YAML and use them as environment variables or mounted configuration files.

20 min·Easy

Kubernetes Secrets

Store passwords, tokens, image pull credentials, and TLS material with Kubernetes Secrets while understanding their security limits.

22 min·Easy

Kubernetes Storage

Compare ephemeral and persistent storage options and understand how Kubernetes separates application pods from durable data.

15 min·Easy

Explore Related Topics

Do

Docker Tutorials

Build the containers Kubernetes orchestrates

Te

Terraform Tutorials

Provision Kubernetes clusters as code

Try the Tool

YAML Validator

Validate Kubernetes manifests and any YAML files instantly.

On This Page

PV and PVC in Plain EnglishScope DifferenceBinding LifecycleAccess ModesReclaim PoliciesFull YAML ExampleBinding DiagramWhy PVCs Are Better for App Teams