---
tags:
- k8s
- l1
- flashcard-deck
- k8s-storage
---
<!-- wiki:breadcrumb:start -->
[Portal](../../../../library/portal/index.md) | **Level:** [L1: Foundations](../../../../library/portal/levels.md) | **Topics:** [Kubernetes Storage](../../../../library/portal/topics.md) | **Domain:** Kubernetes
<!-- wiki:breadcrumb:end -->

id	category	difficulty	tags	question	answer	source_path
k8s-storage/a1b2c3d4e5f6	k8s-storage	easy	k8s, storage, pv, pvc	What is the relationship between a PersistentVolume (PV) and a PersistentVolumeClaim (PVC)?	A PV is a cluster-level storage resource. A PVC is a namespace-scoped request for storage. Pods reference PVCs, and Kubernetes binds PVCs to matching PVs based on access mode, storage class, and capacity. The binding is exclusive.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/b2c3d4e5f6a7	k8s-storage	easy	k8s, storage, access-modes	What are the three classic PersistentVolume access modes and what does each allow?	ReadWriteOnce (RWO): mounted read-write by a single node. ReadOnlyMany (ROX): mounted read-only by many nodes. ReadWriteMany (RWX): mounted read-write by many nodes. RWO is the most common since block storage is single-attach.\n\nRemember: RWO=ReadWriteOnce, ROX=ReadOnlyMany, RWX=ReadWriteMany. O=One, X=Many.	training/library/topics/k8s-storage/primer.md
k8s-storage/c3d4e5f6a7b8	k8s-storage	easy	k8s, storage, storageclass	What is the purpose of a StorageClass in Kubernetes?	A StorageClass defines how storage is provisioned. It names a provisioner (CSI driver), sets provider-specific parameters (disk type, IOPS), configures the reclaim policy, and controls volume binding mode. It enables dynamic provisioning so admins do not need to pre-create PVs.\n\nRemember: StorageClass = PV factory. Dynamic provisioning — no pre-created PVs needed.\n\nExample: `kubectl get sc`. Default SC handles PVCs that omit storageClassName.	training/library/topics/k8s-storage/primer.md
k8s-storage/d4e5f6a7b8c9	k8s-storage	easy	k8s, storage, reclaim-policy	What are the PersistentVolume reclaim policies and when should you use each?	Retain: PV persists after PVC deletion, admin must manually reclaim (use for databases). Delete: PV and underlying storage are deleted when PVC is deleted (use for ephemeral workloads). Recycle is deprecated and should not be used.\n\nRemember: Retain(manual), Delete(auto), Recycle(deprecated). Dynamic default=Delete.\n\nGotcha: Retain→PV becomes Released, not Available. Manual intervention needed.	training/library/topics/k8s-storage/primer.md
k8s-storage/e5f6a7b8c9d0	k8s-storage	medium	k8s, storage, dynamic-provisioning	Explain the dynamic provisioning flow when a pod requests storage via a PVC.	1) Pod references a PVC. 2) PVC references a StorageClass. 3) Kubernetes calls the CSI driver named in the StorageClass. 4) The driver creates the underlying volume. 5) A PV is automatically created and bound to the PVC. 6) The volume is mounted into the pod. WaitForFirstConsumer delays this until a pod is scheduled, ensuring zone alignment.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/f6a7b8c9d0e1	k8s-storage	medium	k8s, storage, volumeBindingMode	What is the difference between Immediate and WaitForFirstConsumer volume binding modes?	Immediate provisions the volume as soon as the PVC is created. WaitForFirstConsumer delays provisioning until a pod using the PVC is scheduled to a node. WaitForFirstConsumer is critical on cloud providers to ensure the volume is created in the same availability zone as the node.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/07a8b9c0d1e2	k8s-storage	medium	k8s, storage, statefulset	How does StatefulSet storage work with volumeClaimTemplates?	StatefulSets use volumeClaimTemplates to create one PVC per replica, named <template>-<statefulset>-<ordinal>. When a pod is rescheduled, it reattaches to its existing PVC. Scaling down does NOT delete PVCs. Deleting the StatefulSet does NOT delete PVCs. PVCs must be manually deleted to reclaim storage.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/18b9c0d1e2f3	k8s-storage	medium	k8s, storage, snapshots	How do you create and restore a VolumeSnapshot in Kubernetes?	Create a VolumeSnapshot referencing a PVC and a VolumeSnapshotClass. To restore, create a new PVC with a dataSource block pointing to the snapshot (kind: VolumeSnapshot). The CSI driver must support snapshots and a VolumeSnapshotClass must exist.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/29c0d1e2f3a4	k8s-storage	hard	k8s, storage, debugging	A PVC is stuck in Pending state. Walk through your debugging process.	1) kubectl describe pvc to check events. Common causes: no matching PV and no StorageClass provisioner (check SC exists and CSI driver pods are healthy), WaitForFirstConsumer mode (normal until a pod is scheduled), storageclass not found (typo in SC name), exceeded ResourceQuota, or requested capacity exceeds provider limits. 2) Check CSI driver pods in kube-system. 3) Check node availability zones vs volume binding mode.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/3ad1e2f3a4b5	k8s-storage	hard	k8s, storage, debugging, mount	A pod fails to start with a multi-attach error on an RWO volume. What happened and how do you fix it?	An RWO volume is still attached to a previous node, usually because the old node was not properly drained or is in a NotReady state. The volume cannot attach to the new node until it is detached from the old one. Fix: force-detach the volume via the cloud provider API or delete the old VolumeAttachment object. Prevent by using proper node drain procedures and setting appropriate pod disruption budgets.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/4be2f3a4b5c6	k8s-storage	hard	k8s, storage, csi	What is the CSI architecture in Kubernetes and how do you verify a CSI driver is healthy?	CSI drivers run as a DaemonSet (node plugin on every node for mount/unmount) and a Deployment (controller for provision/attach/snapshot). Verify health: kubectl get pods -n kube-system -l app=<csi-controller>, kubectl get csinodes (shows which drivers are registered per node), kubectl get csidrivers (shows cluster-wide driver registrations). Unhealthy drivers cause PVC Pending and mount failures.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/5cf3a4b5c6d7	k8s-storage	hard	k8s, storage, capacity, expansion	How does PVC expansion work and what are the operational risks?	PVC expansion requires allowVolumeExpansion: true on the StorageClass. Patch the PVC with a larger storage request. Most CSI drivers support online expansion but some require a pod restart for filesystem resize. Risks: expansion is one-way (cannot shrink), filesystem resize can fail leaving the volume in a resizing condition, and not all storage backends support online expansion. Always snapshot before expanding.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	training/library/topics/k8s-storage/primer.md
k8s-storage/1725371bbed9	k8s-storage	hard	k8s-storage-fundamentals, pv, pvc, storageclass	How does Kubernetes handle storage orchestration, and what are the available storage classes?	Storage Orchestration in Kubernetes:\n* Kubernetes abstracts storage using the StorageClass API.\n* Storage classes define the type of storage, provisioning, and reclaim policies.\n* Dynamic provisioning allows automatic creation of persistent volumes based on demand.\n\nRemember: StorageClass = PV factory. Dynamic provisioning — no pre-created PVs needed.\n\nExample: `kubectl get sc`. Default SC handles PVCs that omit storageClassName.	projects/knowledge/interview/kubernetes/371-how-does-kubernetes-handle-storage-orchestration-a.txt
k8s-storage/46cf018209c3	k8s-storage	medium	k8s-storage-fundamentals, pvc, storageclass	What reclaim policies are there?	* Retain\n* Delete\nNote: Recycle was deprecated in K8s 1.22 and removed in 1.24. Use dynamic provisioning instead.\n\nRemember: Retain(manual), Delete(auto), Recycle(deprecated). Dynamic default=Delete.\n\nGotcha: Retain→PV becomes Released, not Available. Manual intervention needed.	projects/knowledge/interview/kubernetes/227-what-reclaim-policies-are-there.txt
k8s-storage/560bb3005373	k8s-storage	medium	k8s-storage-fundamentals, storageclass, pv	"Explain ""Dynamic Provisioning"" and ""Static Provisioning"""	The main difference relies on the moment when you want to configure storage. For instance, if you need to pre-populate data in a volume, you choose static provisioning. Whereas, if you need to create volumes on demand, you go for dynamic provisioning.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/226-explain-dynamic-provisioning-and-static-provisioni.txt
k8s-storage/6460a19a5733	k8s-storage	medium	k8s-storage-fundamentals, pv, ephemeral	Which problems, volumes in Kubernetes solve?	1. Sharing files between containers running in the same Pod\n2. Storage in containers is ephemeral - it usually doesn't last for long. For example, when a container crashes, you lose all on-disk data. Certain volumes allows to manage such situation by persistent volumes\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/158-which-problems-volumes-in-kubernetes-solve.txt
k8s-storage/761f1b7cea10	k8s-storage	easy	k8s-storage-fundamentals, pv, pvc	True or False? Kubernetes provides data persistence out of the box, so when you restart a pod, data is saved	False. Kubernetes does NOT provide data persistence by default. Container filesystems are ephemeral — data is lost when a Pod restarts. You need PersistentVolumes (PV/PVC) for durable storage.\n\nUnder the hood: PV = cluster-scoped storage (EBS, NFS, local). PVC = namespace-scoped request that binds to a matching PV.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/221-true-or-false-kubernetes-provides-data-persistence.txt
k8s-storage/7c08f4be4401	k8s-storage	medium	k8s-storage-fundamentals, pv, pvc	Explain Volume Snapshots	Volume snapshots let you create a copy of your volume at a specific point in time.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.\n\nRemember: Volume Snapshots are the K8s equivalent of cloud disk snapshots. CSI driver must support the Snapshot capability.\n\nGotcha: Not all storage providers support snapshots. Check `kubectl get volumesnapshotclass` — empty means no snapshot support.	projects/knowledge/interview/kubernetes/224-explain-volume-snapshots.txt
k8s-storage/82fa29234dba	k8s-storage	easy	k8s-storage-fundamentals, pv, pvc	True or False? A volume defined in Pod can be accessed by all the containers of that Pod	True. A volume defined in a Pod spec is accessible to all containers in that Pod. Each container mounts it via volumeMounts, and they can share data through it.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/036-true-or-false-a-volume-defined-in-pod-can-be-acces.txt
k8s-storage/92fba6f9483f	k8s-storage	easy	k8s-storage-fundamentals, pv, pvc	What is a volume in regards to Kubernetes?	A directory accessible by the containers inside a certain Pod and containers. The mechanism responsible for creating the directory, managing it, ... mainly depends on the volume type.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/156-what-is-a-volume-in-regards-to-kubernetes.txt
k8s-storage/a0d4cb18965a	k8s-storage	hard	k8s-storage-fundamentals, pv, pvc, storageclass	How does Kubernetes handle storage orchestration?	* Storage Orchestration: Kubernetes abstracts storage through Persistent Volumes (PVs) and Persistent Volume Claims (PVCs).\n* Administrators provision PVs, and users request storage through PVCs.\n* Storage Classes define the characteristics of the underlying storage, allowing dynamic provisioning.\n* Kubernetes provides a flexible storage model, allowing applications to request and use storage resources without detailed knowledge of the underlying infrastructure.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/332-how-does-kubernetes-handle-storage-orchestration.txt
k8s-storage/a6a829e7c081	k8s-storage	easy	k8s-storage-fundamentals, pv, pvc, storageclass	What is a Persistent Volume (PV) and Persistent Volume Claim (PVC) in Kubernetes?	* Persistent Volume (PV):\n * Represents a piece of storage in the cluster that has been provisioned by an administrator.\n * Can be used to store data independently of any particular pod.\n * Provides a way to manage storage resources in a cluster.\n* Persistent Volume Claim (PVC):\n * Represents a request for storage by a user or pod.\n * Binds to a Persistent Volume, making the storage available to the pod.\n * Allows for dynamic provisioning of storage resources. \nPersistent Volumes and Persistent Volume Claims provide a mechanism for decoupling storage from pod lifecycles.	projects/knowledge/interview/kubernetes/319-what-is-a-persistent-volume-pv-and-persistent-volu.txt
k8s-storage/bb6c87364177	k8s-storage	medium	k8s-storage-fundamentals, pv, pvc	True or False? Kubernetes manages data persistence	False. Kubernetes provides the framework (PV, PVC, StorageClass) but does not manage the actual data persistence. Storage backends (cloud disks, NFS, Ceph) handle the physical storage.\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/225-true-or-false-kubernetes-manages-data-persistence.txt
k8s-storage/bc49b49d81b5	k8s-storage	hard	k8s-storage-fundamentals, ephemeral, access-modes	Provide at least one use-case for each of the following volume types:	* EmptyDir: You need a temporary data that you can afford to lose if the Pod is deleted. For example short-lived data required for one-time operations.\n* hostPath: You need access to paths on the host itself (like data from `/sys` or data generated in `/var/lib`)\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/160-provide-at-least-one-use-case-for-each-of-the-foll.txt
k8s-storage/c4248dfd00c1	k8s-storage	hard	k8s-storage-fundamentals, ephemeral, access-modes	What volume types are you familiar with?	* emptyDir: created when a Pod assigned to a node and ceases to exist when the Pod is no longer running on that node\n* hostPath: mounts a path from the host itself. Usually not used due to security risks but has multiple use-cases where it's needed like access to some internal host paths (`/sys`, `/var/lib`, etc.)\n\nRemember: Storage abstraction: StorageClass→PV→PVC→Pod mount. Dynamic provisioning automates PV.	projects/knowledge/interview/kubernetes/157-what-volume-types-are-you-familiar-with.txt
k8s-storage/cd998310201f	k8s-storage	medium	k8s-storage-fundamentals, pv, ephemeral	Explain ephemeral volume types vs. persistent volumes in regards to Pods	Ephemeral volume types have the lifetime of a pod as opposed to persistent volumes which exist beyond the lifetime of a Pod.\n\nRemember: PV lifecycle: Available→Bound→Released. Modes: RWO, ROX, RWX.\n\nRemember: O=One, X=Many. RWO=one writer, ROX=many readers, RWX=many writers.\n\nRemember: Ephemeral = pod lifetime (emptyDir, configMap, secret). Persistent = beyond pod lifetime (PVC to PV).\n\nAnalogy: Ephemeral volumes are like RAM — fast, temporary. Persistent volumes are like disk — slower, durable.	projects/knowledge/interview/kubernetes/159-explain-ephemeral-volume-types-vs-persistent-volum.txt
k8s-storage/d31e605e3928	k8s-storage	medium	k8s-storage-fundamentals, pv, pvc	"Explain ""Persistent Volumes"". Why do we need it?"	Persistent Volumes allow us to save data so basically they provide storage that doesn't depend on the pod lifecycle.\n\nRemember: PV lifecycle: Available→Bound→Released. Modes: RWO, ROX, RWX.\n\nRemember: O=One, X=Many. RWO=one writer, ROX=many readers, RWX=many writers.	projects/knowledge/interview/kubernetes/222-explain-persistent-volumes-why-do-we-need-it.txt
k8s-storage/dfdc9ad7c6b8	k8s-storage	medium	k8s-storage-fundamentals, pv, csi, access-modes	What types of persistent volumes are there?	* NFS\n* iSCSI\n* CephFS\n* ...\n\nRemember: PV lifecycle: Available→Bound→Released. Modes: RWO, ROX, RWX.\n\nRemember: O=One, X=Many. RWO=one writer, ROX=many readers, RWX=many writers.	projects/knowledge/interview/kubernetes/223-what-types-of-persistent-volumes-are-there.txt

<!-- wiki:related:start -->
---

## Wiki Navigation

### Related Content

- [Case Study: Persistent Volume Stuck Terminating](../../../../library/case-studies/kubernetes_ops/persistent-volume-stuck-terminating/README.md) (Case Study, L2) — Kubernetes Storage
- [Database Operations on Kubernetes](../../../../library/topics/database-ops/index.md) (Topic Pack, L2) — Kubernetes Storage
- [K8s Storage](../../../../library/topics/k8s-storage/index.md) (Topic Pack, L1) — Kubernetes Storage
- Kubernetes Exercises (Quest Ladder) *(CLI)* (Exercise Set, L1) — Kubernetes Storage
- [Runbook: PVC Stuck in Pending](../../../../library/runbooks/kubernetes/pvc-pending.md) (Runbook, L1) — Kubernetes Storage
- [Track: Kubernetes Core](../../../../library/curriculum/tracks/kubernetes_core.md) (Reference, L1) — Kubernetes Storage

<!-- wiki:related:end -->
