Kubernetes Container Orchestration Storage Solutions 2 — Questions and Answers
Question 1: Which Kubernetes object allows a pod to request storage without knowing the underlying storage implementation?
- StorageClass
- PersistentVolumeClaim (Correct answer)
- VolumeMount
- ConfigMap
Correct answer: PersistentVolumeClaim
A PersistentVolumeClaim (PVC) abstracts storage details so pods can request storage without awareness of the underlying provider.
Question 2: What happens to a PersistentVolume with ReclaimPolicy 'Retain' after its PVC is deleted?
- The PV is deleted automatically
- The PV is released but data is preserved and must be manually reclaimed (Correct answer)
- The PV is immediately rebound to the next available PVC
- The PV enters a Pending state waiting for rebinding
Correct answer: The PV is released but data is preserved and must be manually reclaimed
With the Retain policy, the PV moves to Released state and retains its data, requiring manual administrator intervention to reclaim.
Question 3: Which access mode allows a PersistentVolume to be mounted as read-write by many nodes simultaneously?
- ReadWriteOnce
- ReadOnlyMany
- ReadWriteMany (Correct answer)
- ReadWriteOncePod
Correct answer: ReadWriteMany
ReadWriteMany (RWX) permits the volume to be mounted read-write by multiple nodes at the same time.
Question 4: In a StorageClass definition, what field specifies how volumes are provisioned when a PVC is created?
- reclaimPolicy
- volumeBindingMode
- provisioner (Correct answer)
- allowVolumeExpansion
Correct answer: provisioner
The 'provisioner' field in a StorageClass identifies the plugin or driver (e.g., kubernetes.io/aws-ebs) responsible for creating volumes.
Question 5: What does the 'volumeBindingMode: WaitForFirstConsumer' setting on a StorageClass accomplish?
- Delays PV provisioning until a pod using the PVC is scheduled (Correct answer)
- Binds the PV to a PVC immediately upon PVC creation
- Prevents dynamic provisioning entirely
- Reserves the volume for the first pod that starts
Correct answer: Delays PV provisioning until a pod using the PVC is scheduled
WaitForFirstConsumer defers volume binding and provisioning until a pod that uses the PVC is actually scheduled, enabling topology-aware placement.
Question 6: Which CSI (Container Storage Interface) operation is responsible for attaching a volume to a node?
- NodeStageVolume
- ControllerPublishVolume (Correct answer)
- NodePublishVolume
- CreateVolume
Correct answer: ControllerPublishVolume
ControllerPublishVolume attaches a CSI volume to a specific node, analogous to attaching a cloud disk to a VM.
Question 7: A pod using an emptyDir volume is deleted and rescheduled on a different node. What happens to the data?
- Data is preserved and remounted on the new node
- Data is lost because emptyDir is tied to the pod's lifecycle on that node (Correct answer)
- Data is migrated automatically via the kubelet
- Data persists in etcd until manually cleared
Correct answer: Data is lost because emptyDir is tied to the pod's lifecycle on that node
An emptyDir volume exists only as long as the pod runs on a given node; when the pod is deleted the data is permanently erased.
Which Kubernetes object allows a pod to request storage without knowing the underlying storage implementation?