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 | β |