Kubernetes Container Orchestration Storage Solutions 3 — Questions and Answers
Question 1: Which Kubernetes feature allows a PersistentVolumeClaim to request more storage after initial provisioning?
- Volume Snapshot
- Volume Expansion (Correct answer)
- Dynamic Provisioning
- Volume Cloning
Correct answer: Volume Expansion
Volume Expansion, enabled via allowVolumeExpansion: true on the StorageClass, lets you resize a PVC to request additional capacity.
Question 2: What is the purpose of a VolumeSnapshot in Kubernetes?
- To clone a PVC into a new PVC of the same size
- To capture a point-in-time copy of a PersistentVolume for backup or restore (Correct answer)
- To migrate volumes between storage classes
- To replicate data across multiple nodes
Correct answer: To capture a point-in-time copy of a PersistentVolume for backup or restore
A VolumeSnapshot captures the state of a PersistentVolume at a specific moment, enabling backup, disaster recovery, or creating new volumes from the snapshot.
Question 3: Which resource must exist before you can create a VolumeSnapshot in Kubernetes?
- VolumeSnapshotClass (Correct answer)
- StorageClass with snapshotting enabled
- PersistentVolumeSnapshot controller
- VolumeBackupPolicy
Correct answer: VolumeSnapshotClass
A VolumeSnapshotClass must be defined to specify the CSI driver and parameters used to create snapshots, similar to how StorageClass works for PVCs.
Question 4: How can you pre-populate a new PVC with data from an existing PVC without using a snapshot?
- Set the dataSource field of the new PVC to reference the existing PVC (Correct answer)
- Use kubectl cp to copy data between PVCs directly
- Create a Job that mounts both PVCs and copies files
- Set cloneFrom in the StorageClass parameters
Correct answer: Set the dataSource field of the new PVC to reference the existing PVC
Volume cloning allows a new PVC to set its dataSource to an existing PVC of the same StorageClass, creating a deep copy of the data.
Question 5: A StatefulSet with 3 replicas uses a volumeClaimTemplate. How many PersistentVolumeClaims are created?
- 1 shared PVC for all pods
- 3 PVCs, one per pod replica (Correct answer)
- 0 — StatefulSets use hostPath by default
- 6 — two PVCs per replica for redundancy
Correct answer: 3 PVCs, one per pod replica
Each StatefulSet pod gets its own PVC created from the volumeClaimTemplate, ensuring stable, unique storage per replica.
Question 6: What is the role of the external-provisioner sidecar container in a CSI driver deployment?
- It mounts volumes inside the container filesystem
- It watches for PVC objects and calls CreateVolume on the CSI driver (Correct answer)
- It handles node registration and topology reporting
- It enforces StorageClass reclaim policies
Correct answer: It watches for PVC objects and calls CreateVolume on the CSI driver
The external-provisioner sidecar monitors PVC creation events and triggers the CSI driver's CreateVolume RPC to dynamically provision storage.
Question 7: Which field in a PodSpec enables a pod to use a specific PersistentVolumeClaim?
- volumes[].persistentVolumeClaim.claimName (Correct answer)
- storage.claimRef.name
- spec.volumeClaim.name
- volumeMounts[].pvcName
Correct answer: volumes[].persistentVolumeClaim.claimName
Under spec.volumes, you define a volume with persistentVolumeClaim.claimName pointing to the PVC name, then reference it in volumeMounts.
Which Kubernetes feature allows a PersistentVolumeClaim to request more storage after initial provisioning?