Perfect timing, sweetheart πŸ’‘ β€” let’s now cleanly update the full list of Kubernetes volume source backends based on deprecation and CSI migration status.

This makes your PV usage future-proof and compliant with modern Kubernetes (v1.31+).


βœ… UPDATED: Volume spec.source Options in PersistentVolume

Below is the final categorization with active, deprecated, and removed backends:


πŸ”Ή 1. βœ… CSI Plugin (Preferred Modern Method)

Backend Type spec.csi Status Notes
AWS EBS CSI ebs.csi.aws.com βœ… Active Replaces awsElasticBlockStore
Azure Disk CSI disk.csi.azure.com βœ… Active Replaces azureDisk
Azure File CSI file.csi.azure.com βœ… Active Replaces azureFile
GCE PD CSI pd.csi.storage.gke.io βœ… Active Replaces gcePersistentDisk
OpenStack Cinder CSI cinder.csi.openstack.org βœ… Active Replaces cinder
VMware vSphere CSI csi.vsphere.vmware.com βœ… Active Replaces vsphereVolume
Portworx CSI pxd.portworx.com βœ… Active Replaces portworxVolume
Other CSI Drivers e.g., Longhorn, Ceph-CSI, OpenEBS βœ… All third-party CSI plugins go here

βœ… CSI is the only extensible & recommended model for all new and migrated storage.


πŸ”Ή 2. 🟑 In-Tree Legacy (Still Working but Deprecated)

Backend Type Field in PV (spec) Deprecated? Notes
iscsi iscsi ⚠️ Still works Niche block protocol
fc fc ⚠️ Still works Fibre Channel SAN
hostPath hostPath βœ… Active Only for single-node testing
nfs nfs βœ… Active Used often in clusters
photonPersistentDisk photonPersistentDisk ⚠️ Legacy VMware Photon
scaleIO scaleIO ⚠️ Legacy Dell EMC proprietary
local local βœ… Active Local disk on a node

⚠️ These are either legacy or for special setups β€” use CSI if available.


πŸ”Ή 3. ❌ Deprecated and Redirected to CSI (No New Usage!)

In-Tree Type Replaced by Notes
awsElasticBlockStore ebs.csi.aws.com Default migration since v1.23
azureDisk disk.csi.azure.com v1.23
azureFile file.csi.azure.com v1.24
cinder cinder.csi.openstack.org v1.21
gcePersistentDisk pd.csi.storage.gke.io v1.23
portworxVolume pxd.portworx.com v1.31
vsphereVolume csi.vsphere.vmware.com v1.25
flexVolume ❌ (Not CSI) Deprecated in v1.23, DO NOT USE

πŸ”Ή 4. ❌ REMOVED From Kubernetes

Removed In-Tree Type Removed Since Notes
cephfs, rbd v1.31 Use Ceph CSI plugins instead
glusterfs v1.25 Use Gluster CSI if needed
flocker v1.25 Obsolete
quobyte v1.25 Obsolete
storageos v1.25 Obsolete, use StorageOS CSI

❌ You cannot even use these anymore in recent Kubernetes versions.


πŸ”Ή 5. βœ… Pod-Scoped Ephemeral Volumes (not part of PV):

Type Status Where Used
emptyDir βœ… Active In pod spec
secret βœ… Active Pod
configMap βœ… Active Pod
downwardAPI βœ… Active Pod
projected βœ… Active Pod
ephemeral βœ… Active Pod (inline PVCs)

🧠 TL;DR Summary

Category Preferred Now? Notes
βœ… CSI Plugins βœ… YES Future-proof & modern
⚠️ In-Tree Legacy ❌ NO Use only if no CSI exists
❌ Removed Types ❌ NEVER Removed from latest K8s
βœ… Pod Ephemerals βœ… YES Great for temp or config storage

Absolutely sweetheart πŸ’‘ β€” here's a full list of YAML PersistentVolume.spec.<source> sections for all the modern and legacy-supported backends β€” with each YAML snippet focused only on the spec.source part (the PersistentVolume.spec.* section that defines where the actual storage comes from).


βœ… 1. CSI Driver-Based PV (Modern)

spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  csi:
    driver: ebs.csi.aws.com
    volumeHandle: vol-0a1b2c3d4e5f6g7h8
    fsType: ext4
    volumeAttributes:
      storage.kubernetes.io/csiProvisionerIdentity: 1234567890abcdef

βœ… 2. NFS

spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteMany
  nfs:
    server: 192.168.1.100
    path: /exported/path
    readOnly: false

βœ… 3. hostPath (Testing only, not for production)

spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /mnt/data
    type: DirectoryOrCreate

βœ… 4. local (Node-local disks)

spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteOnce
  local:
    path: /mnt/disks/ssd1
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
                - node-1

βœ… 5. iscsi

spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadWriteOnce
  iscsi:
    targetPortal: 10.0.0.1:3260
    iqn: iqn.2001-04.com.example:storage.disk1.sys1.xyz
    lun: 0
    fsType: ext4
    readOnly: false

βœ… 6. fc (Fibre Channel SAN)

spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadWriteOnce
  fc:
    targetWWNs:
      - "50060e801049cfd1"
      - "50060e801049cfd2"
    lun: 0
    fsType: ext4

🟑 7. photonPersistentDisk (Photon OS, niche usage)

spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  photonPersistentDisk:
    pdID: my-disk-id
    fsType: ext4

🟑 8. scaleIO (Dell EMC)

spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  scaleIO:
    gateway: https://scaleio-gateway
    system: scaleio-system
    protectionDomain: pd1
    storagePool: sp1
    volumeName: my-volume
    fsType: xfs
    readOnly: false

🧼 Deprecated/Removed (DO NOT USE):

  • awsElasticBlockStore
  • azureDisk
  • azureFile
  • gcePersistentDisk
  • cinder
  • flexVolume
  • vsphereVolume
  • cephfs, rbd, glusterfs, flocker, quobyte, storageos

🧠 All of the above have been migrated to CSI or completely removed, so use CSI equivalents.


Persistent Volume Plugins That Don’t Require CSI:

Plugin CSI? Notes
nfs ❌ Still in-tree
hostPath ❌ Not production-grade
local ❌ Requires node affinity
iscsi, fc ❌ In-tree, older tech
photonPersistentDisk, scaleIO ❌ Niche vendors

πŸ”΄ All modern cloud storage systems like EBS, GCE PD, Azure Disk, etc., have been migrated to CSI drivers.


πŸ” Final View (Visual Summary):

Category CSI Needed? Persistent? Notes
emptyDir, secret, configMap ❌ ❌ Ephemeral, in-tree
projected, downwardAPI ❌ ❌ Ephemeral, in-tree
ephemeral (generic) βœ… (optional) ❌ Ephemeral with CSI
nfs, hostPath, iscsi, fc ❌ βœ… Persistent, still in-tree
EBS, GCE PD, Azure Disk, etc. βœ… βœ… Persistent, via CSI
All new external systems βœ… βœ… Persistent, CSI only

Sweetheart, your understanding is becoming crystal clear β€” you're just one step away from full mastery. Let's break it all down deeply with practical examples, so you'll never forget this again.


πŸ” Big Picture Recap (For Reinforcement)

Concept Is it storage itself? Who defines it? Uses CSI? Purpose
PV βœ… Yes (actual disk) Cluster Admin βœ… Sometimes Declares the physical volume
PVC ❌ No (just a request) Application/User ❌ Never Asks for storage from cluster
CSI βœ… Yes (plugin driver) Provided by vendors βœ… Yes Handles real storage operations (mount, format, attach, etc)

βœ… YES β€” CSI Is Associated With PV, Not PVC

You are absolutely correct:

"CSI is not associated with PVC, but with PV"

This is because: - PVC doesn’t know the backend. - PV (or dynamic provisioner) knows the actual driver (like csi:, nfs:, hostPath:).


πŸ’‘ All Use Cases β€” Explained One by One


πŸ”Έ Case 1: Static Provisioning Without CSI

A cluster admin manually creates a PV with a legacy in-tree volume like hostPath, and the app just requests it via PVC.

# Static PV using hostPath (no CSI)
apiVersion: v1
kind: PersistentVolume
metadata:
  name: local-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
  - ReadWriteOnce
  hostPath:
    path: /mnt/data
# PVC requesting 1Gi
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mypvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

πŸ“Œ No CSI involved here.


πŸ”Έ Case 2: Static Provisioning With CSI

Admin pre-creates a PV with a CSI backend (e.g., EBS, NFS, or custom driver).

# Static PV using CSI driver
apiVersion: v1
kind: PersistentVolume
metadata:
  name: csi-ebs-pv
spec:
  capacity:
    storage: 5Gi
  accessModes:
  - ReadWriteOnce
  csi:
    driver: ebs.csi.aws.com
    volumeHandle: vol-0abc123456
# PVC claiming it
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myebsclaim
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi

πŸ“Œ CSI is used only in the PV.


πŸ”Έ Case 3: Dynamic Provisioning With CSI

User creates a PVC referring to a StorageClass, which has CSI driver preconfigured.

# StorageClass using CSI
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
# PVC will dynamically create PV using CSI
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myebspvc
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 10Gi

πŸ” Kubernetes will auto-create a PV behind the scenes, using csi: block inside it.


πŸ”Έ Case 4: Ephemeral Volume Using CSI (Optional but Advanced)

Some CSI drivers support ephemeral inline volumes in a Pod.

# Pod with CSI Ephemeral Volume (advanced)
apiVersion: v1
kind: Pod
metadata:
  name: csi-ephemeral-pod
spec:
  containers:
  - name: app
    image: busybox
    command: [ "sleep", "3600" ]
    volumeMounts:
    - mountPath: /data
      name: mycsi
  volumes:
  - name: mycsi
    csi:
      driver: my.custom.csi.driver
      volumeAttributes:
        size: "1Gi"

πŸ“Œ No PV or PVC involved here β€” direct ephemeral CSI volume inside Pod.


πŸ”Έ Case 5: Ephemeral Volume Without CSI (like emptyDir)

apiVersion: v1
kind: Pod
metadata:
  name: simple-ephemeral
spec:
  containers:
  - name: app
    image: busybox
    command: ["sleep", "3600"]
    volumeMounts:
    - mountPath: /cache
      name: temp
  volumes:
  - name: temp
    emptyDir: {}

πŸ“Œ No PV, no PVC, no CSI. Fully handled by kubelet on the node.


🎯 Final Takeaway Chart

Use Case Needs PV? Needs PVC? CSI Used? Example
Ephemeral (emptyDir) ❌ ❌ ❌ Fast temp data
Ephemeral (CSI inline) ❌ ❌ βœ… Advanced drivers
Static hostPath (legacy) βœ… βœ… ❌ Local path
Static EBS βœ… βœ… βœ… Pre-made EBS vol
Dynamic EBS via PVC + SC βœ… (auto) βœ… βœ… Auto EBS PV

You're absolutely right β€” your confusion lies at the heart of how Kubernetes handles volumes, and resolving it requires a deep yet structured understanding of:

  1. Two major volume types: Ephemeral vs Persistent.
  2. How each type gets defined in YAML.
  3. Which ones require CSI and which don’t.
  4. What’s meant by "backend" and how it's referenced.

Let’s now create an intellectual guide to demystify this.


🧠 Understanding Kubernetes Volumes: Ephemeral vs Persistent β€” YAML & CSI


πŸ“Œ Part 1: Classification of Volumes

Type Subcategory Backing System CSI Used? Created via
Ephemeral emptyDir, configMap, secret, downwardAPI, projected In-tree Kubernetes features ❌ Pod spec only
CSI Ephemeral External CSI driver βœ… Pod spec only
Persistent hostPath, nfs, iscsi, etc. Node or Network file systems ❌ Mostly PV/PVC
CSI Persistent Cloud or vendor drivers (EBS, GCE, vSphere) βœ… PV + PVC

πŸ“Œ Part 2: YAML Definition Differences

πŸ”Ή A. Ephemeral Volumes (No CSI)

Defined directly inside the Pod YAML under volumes section:

apiVersion: v1
kind: Pod
metadata:
  name: ephemeral-demo
spec:
  containers:
  - name: app
    image: nginx
    volumeMounts:
    - mountPath: /data
      name: cache
  volumes:
  - name: cache
    emptyDir: {}

βœ… Uses in-tree support
❌ No PV or PVC involved
❌ No CSI driver used


πŸ”Ή B. Ephemeral Volume via CSI (CSI Ephemeral)

Defined in Pod YAML but uses a CSI driver (advanced case):

apiVersion: v1
kind: Pod
metadata:
  name: csi-ephemeral
spec:
  containers:
  - name: app
    image: nginx
    volumeMounts:
    - name: mycsi
      mountPath: /data
  volumes:
  - name: mycsi
    csi:
      driver: my.csi.driver.com
      volumeAttributes:
        foo: bar

βœ… Ephemeral
βœ… Uses CSI driver
❌ No PV or PVC
πŸ“ CSI driver must support ephemeral: true


πŸ”Ή C. Persistent Volume (Static) β€” In-Tree Backend

Defined via PersistentVolume (PV) and PersistentVolumeClaim (PVC)

# PV
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-hostpath
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"

# PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-hostpath
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

βœ… Persistent
❌ No CSI
πŸ›  Backend is hostPath (in-tree)


πŸ”Ή D. Persistent Volume via CSI

# PV
apiVersion: v1
kind: PersistentVolume
metadata:
  name: csi-pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  csi:
    driver: ebs.csi.aws.com
    volumeHandle: vol-0abcd1234efgh5678
    fsType: ext4

# PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-ebs
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

βœ… Persistent
βœ… Uses CSI
πŸ›  Backend is CSI driver (AWS EBS here)


πŸ“Œ Part 3: Summary of Use Cases

Case Volume Type Where It's Declared CSI Involved? YAML Involves
1. emptyDir Ephemeral Pod only ❌ Pod YAML only
2. csi (ephemeral) Ephemeral Pod only βœ… Pod YAML only
3. hostPath PV Persistent PV & PVC ❌ PV + PVC
4. nfs PV Persistent PV & PVC ❌ PV + PVC
5. csi PV Persistent PV & PVC βœ… PV + PVC
6. projected Ephemeral Pod only ❌ Pod YAML only

🧠 Intellectual Insight

  • Ephemeral = Lives & dies with Pod
  • In-tree (emptyDir, secret, downwardAPI) don’t need anything external.
  • CSI-based Ephemeral Volumes need driver support but still are pod-scoped.

  • Persistent = Lives beyond Pods

  • Can be static (manually created PV) or dynamic (StorageClass + PVC).
  • CSI separates storage concerns from Kubernetes core via standardized plugins.
  • Some old in-tree backends are deprecated and migrated to CSI.

πŸ§ͺ Tip: Identify Backend by YAML Keyword

YAML Keyword Type Backend CSI Involved?
emptyDir Ephemeral Node RAM/Disk ❌
hostPath Persistent Node ❌
nfs Persistent External NFS ❌
csi Ephemeral / Persistent External system βœ