KCNA Storage & Persistent Volumes 2 — Questions and Answers
Question 1: Which field in a PersistentVolumeClaim spec determines how much storage is requested?
- spec.capacity
- spec.resources.requests.storage (Correct answer)
- spec.storage.limit
- spec.volumeSize
Correct answer: spec.resources.requests.storage
The spec.resources.requests.storage field in a PVC defines how much storage the claim requests from a PersistentVolume.
Question 2: What happens to a PersistentVolume with Reclaim Policy 'Retain' when its PVC is deleted?
- The PV is immediately deleted
- The PV is scrubbed and made available again
- The PV moves to 'Released' status and data is preserved (Correct answer)
- The PV is automatically bound to the next matching PVC
Correct answer: The PV moves to 'Released' status and data is preserved
With the Retain policy, deleting the PVC releases the PV (status becomes 'Released') but the data remains intact until an administrator manually reclaims it.
Question 3: Which StorageClass parameter controls whether volumes can be expanded after creation?
- volumeBindingMode
- allowVolumeExpansion (Correct answer)
- reclaimPolicy
- provisioner
Correct answer: allowVolumeExpansion
The allowVolumeExpansion field set to true in a StorageClass enables PVCs using that class to request more storage after initial provisioning.
Question 4: A Pod mounts a PVC with ReadWriteOnce access mode. What does this allow?
- Many nodes can read/write simultaneously
- Only one node can mount the volume in read/write mode (Correct answer)
- Only read operations are permitted
- One Pod per namespace can mount the volume
Correct answer: Only one node can mount the volume in read/write mode
ReadWriteOnce (RWO) means the volume can be mounted as read-write by a single node at a time.
Question 5: Which Kubernetes object is created automatically when dynamic provisioning is triggered by a PVC?
- StorageClass
- PersistentVolume (Correct answer)
- VolumeAttachment
- CSIDriver
Correct answer: PersistentVolume
When a PVC references a StorageClass with a provisioner, Kubernetes dynamically creates a PersistentVolume object and binds it to the PVC.
Question 6: What is the purpose of the 'volumeBindingMode: WaitForFirstConsumer' setting in a StorageClass?
- It delays PVC creation until a Pod requests it
- It delays volume provisioning until a Pod using the PVC is scheduled (Correct answer)
- It reserves the volume for the first namespace that claims it
- It prevents binding until the admin approves
Correct answer: It delays volume provisioning until a Pod using the PVC is scheduled
WaitForFirstConsumer delays volume binding and provisioning until a Pod using the PVC is actually scheduled, enabling topology-aware provisioning.
Question 7: Which command shows the current status and binding information of all PersistentVolumes in a cluster?
- kubectl describe storageclass
- kubectl get pvc -A
- kubectl get pv (Correct answer)
- kubectl get volumes
Correct answer: kubectl get pv
kubectl get pv lists all PersistentVolumes cluster-wide, showing their capacity, access modes, reclaim policy, status, and bound claim.
Which field in a PersistentVolumeClaim spec determines how much storage is requested?