KCNA Storage Solutions 5 — Questions and Answers
Question 1: In a cloud-native architecture, which pattern best describes using object storage (like S3) instead of block storage for application data?
- Stateful persistent storage via PVCs
- Ephemeral emptyDir storage
- Externalizing state to a managed object store accessed via SDK or API (Correct answer)
- Using hostPath volumes on cloud VMs
Correct answer: Externalizing state to a managed object store accessed via SDK or API
Cloud-native design favors externalized object storage accessed via API/SDK over block storage mounted in pods, enabling better scalability and decoupling.
Question 2: What is the role of the 'node-driver-registrar' CSI sidecar?
- It provisions new PersistentVolumes on behalf of the CSI controller
- It registers the CSI driver with the kubelet on each node using the kubelet plugin registration mechanism (Correct answer)
- It watches PVCs and triggers volume attachment
- It takes volume snapshots on a scheduled basis
Correct answer: It registers the CSI driver with the kubelet on each node using the kubelet plugin registration mechanism
The node-driver-registrar sidecar uses the kubelet plugin registration API to make the kubelet aware of the CSI driver on a given node.
Question 3: Which of the following volume types is most appropriate for sharing temporary data between containers in the same pod?
- PersistentVolumeClaim
- hostPath
- emptyDir (Correct answer)
- nfs
Correct answer: emptyDir
emptyDir volumes are created when a pod starts and are shared among all containers in that pod, making them ideal for inter-container scratch space.
Question 4: A storage administrator wants a PV to only be bound to a specific PVC before it is created. Which mechanism achieves this?
- Setting a matchLabels selector on the PV
- Pre-populating the claimRef field on the PV with the target PVC details (Correct answer)
- Using WaitForFirstConsumer binding mode
- Adding a finalizer annotation to the PVC
Correct answer: Pre-populating the claimRef field on the PV with the target PVC details
Pre-setting the claimRef on a PV with the namespace and name of the intended PVC ensures only that PVC can bind to it during static provisioning.
Question 5: Which Kubernetes feature allows administrators to define storage capacity constraints per topology zone so the scheduler can make better pod placement decisions?
- VolumeSchedulingMode
- StorageCapacity API (CSIStorageCapacity objects) (Correct answer)
- TopologySpreadConstraints on PVCs
- NodeAffinity on StorageClasses
Correct answer: StorageCapacity API (CSIStorageCapacity objects)
CSIStorageCapacity objects let CSI drivers report available storage capacity per topology zone, enabling the Kubernetes scheduler to factor storage availability into pod placement.
Question 6: What does the 'ReadWriteOncePod' (RWOP) access mode enforce compared to 'ReadWriteOnce' (RWO)?
- RWOP allows one node to mount the volume while RWO allows multiple nodes
- RWOP restricts volume access to a single pod cluster-wide, while RWO allows multiple pods on one node (Correct answer)
- RWOP is for block volumes only while RWO is for filesystem volumes
- RWOP requires CSI version 1.0 or lower while RWO works with all versions
Correct answer: RWOP restricts volume access to a single pod cluster-wide, while RWO allows multiple pods on one node
ReadWriteOncePod guarantees that only a single pod in the entire cluster can mount the volume with read-write access, providing stronger exclusivity than RWO.
Question 7: Which approach is recommended for migrating from an in-tree volume plugin to its CSI equivalent in Kubernetes?
- Manually delete all PVs and recreate them using the CSI driver
- Enable the CSIMigration feature gates so existing PV/PVC objects are automatically handled by the CSI driver (Correct answer)
- Annotate each PV with the new CSI driver name and restart the kubelet
- Create a new StorageClass and remount all volumes using a migration job
Correct answer: Enable the CSIMigration feature gates so existing PV/PVC objects are automatically handled by the CSI driver
CSI Migration feature gates transparently redirect in-tree volume plugin operations to the corresponding CSI driver without requiring users to recreate PVs or PVCs.
In a cloud-native architecture, which pattern best describes using object storage (like S3) instead of block storage for application data?