KCNA Storage & Persistent Volumes 4 — Questions and Answers
Question 1: Which PersistentVolume reclaim policy automatically deletes the volume and its data when the PVC is deleted?
- Retain
- Recycle
- Delete (Correct answer)
- Archive
Correct answer: Delete
The Delete reclaim policy causes Kubernetes to delete both the PV object and the underlying storage asset when the bound PVC is deleted.
Question 2: What does the ReadWriteOncePod (RWOP) access mode enforce that ReadWriteOnce does not?
- Volume can only be mounted by one container
- Volume can only be mounted by a single Pod across the entire cluster (Correct answer)
- Volume is read-only for all except one Pod
- Volume binding is deferred until the Pod is scheduled
Correct answer: Volume can only be mounted by a single Pod across the entire cluster
RWOP restricts the volume to a single Pod cluster-wide, whereas RWO only restricts to a single node (multiple Pods on the same node could still mount it).
Question 3: A StatefulSet is deployed with 3 replicas and a volumeClaimTemplate. How many PVCs will be created?
- 1 shared PVC for all replicas
- 3 PVCs, one per replica (Correct answer)
- Depends on the StorageClass access mode
- None—StatefulSets don't use PVCs
Correct answer: 3 PVCs, one per replica
StatefulSets create one PVC per replica from the volumeClaimTemplate, giving each Pod its own dedicated persistent storage.
Question 4: Which field in a Pod spec allows you to specify the name of a PVC to mount as a volume?
- spec.volumes[].hostPath.path
- spec.volumes[].persistentVolumeClaim.claimName (Correct answer)
- spec.volumes[].configMap.name
- spec.storage.claim
Correct answer: spec.volumes[].persistentVolumeClaim.claimName
The spec.volumes[].persistentVolumeClaim.claimName field references a PVC by name, making it available as a volume in the Pod.
Question 5: What status will a PVC show if no PersistentVolume matches its requirements and no dynamic provisioner is configured?
- Bound
- Pending (Correct answer)
- Failed
- Unschedulable
Correct answer: Pending
A PVC that cannot be bound to a matching PV stays in Pending status until a suitable volume becomes available.
Question 6: Which Kubernetes feature allows you to create a PVC from an existing VolumeSnapshot to restore data?
- Volume cloning via dataSource referencing a PVC
- VolumeSnapshot restore via dataSource referencing a VolumeSnapshot (Correct answer)
- StorageClass restore parameter
- PV import from snapshot annotation
Correct answer: VolumeSnapshot restore via dataSource referencing a VolumeSnapshot
Setting the PVC's spec.dataSource to reference a VolumeSnapshot triggers the CSI driver to restore the snapshot into the new volume.
Question 7: Why would you choose a hostPath volume in a Kubernetes Pod?
- To share data across all nodes in the cluster
- To access a specific file or directory on the node's filesystem (Correct answer)
- To automatically replicate data to a cloud provider
- To isolate data between namespaces
Correct answer: To access a specific file or directory on the node's filesystem
hostPath mounts a file or directory from the host node's filesystem into the Pod, useful for node-level access but non-portable across nodes.
Which PersistentVolume reclaim policy automatically deletes the volume and its data when the PVC is deleted?