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):¶
awsElasticBlockStoreazureDiskazureFilegcePersistentDiskcinderflexVolumevsphereVolumecephfs,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:
- Two major volume types: Ephemeral vs Persistent.
- How each type gets defined in YAML.
- Which ones require CSI and which don’t.
- 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 | ✅ |