KCNA Storage & Persistent Volumes 3 — Questions and Answers
Question 1: In a Pod spec, which field under a container references a named volume defined in spec.volumes?
- volumeMounts[].name (Correct answer)
- volumes[].mountPath
- storage[].name
- claims[].name
Correct answer: volumeMounts[].name
The volumeMounts[].name field in a container spec must match the name of a volume defined in spec.volumes to mount it.
Question 2: Which CSI operation is responsible for attaching a volume to a node before it is mounted to a Pod?
- NodePublishVolume
- ControllerPublishVolume (Correct answer)
- NodeStageVolume
- CreateVolume
Correct answer: ControllerPublishVolume
ControllerPublishVolume is the CSI call that attaches a volume to a node, which must happen before NodeStageVolume or NodePublishVolume mount it.
Question 3: What does a VolumeSnapshot object represent in Kubernetes?
- A backup of all PVCs in a namespace
- A point-in-time snapshot of a PersistentVolume's data (Correct answer)
- A copy of a StorageClass configuration
- An exported image of a container's filesystem
Correct answer: A point-in-time snapshot of a PersistentVolume's data
A VolumeSnapshot represents a point-in-time snapshot of a PersistentVolume, enabling data backup and restore workflows.
Question 4: Which access mode allows a PersistentVolume to be mounted as read-only by many nodes simultaneously?
- ReadWriteOnce
- ReadOnlyMany (Correct answer)
- ReadWriteMany
- ReadWriteOncePod
Correct answer: ReadOnlyMany
ReadOnlyMany (ROX) allows a volume to be mounted read-only by multiple nodes at the same time.
Question 5: A developer needs a temporary directory shared between two containers in the same Pod that disappears when the Pod exits. Which volume type fits best?
- persistentVolumeClaim
- emptyDir (Correct answer)
- hostPath
- configMap
Correct answer: emptyDir
emptyDir volumes are created when a Pod starts and deleted when it terminates, making them ideal for temporary inter-container sharing.
Question 6: What is the role of the external-provisioner sidecar in a CSI deployment?
- It mounts volumes on nodes
- It watches for PVC objects and calls CreateVolume on the CSI driver (Correct answer)
- It snapshots volumes on a schedule
- It registers the CSI driver with kubelet
Correct answer: It watches for PVC objects and calls CreateVolume on the CSI driver
The external-provisioner sidecar watches for new PVC objects and triggers CreateVolume calls to the CSI driver to provision backing storage.
Question 7: Which Kubernetes resource allows an administrator to set default StorageClass behavior for a namespace?
- ResourceQuota
- LimitRange
- StorageClass with 'default' annotation (Correct answer)
- NetworkPolicy
Correct answer: StorageClass with 'default' annotation
Annotating a StorageClass with storageclass.kubernetes.io/is-default-class: 'true' makes it the default for PVCs that don't specify a storageClassName.
In a Pod spec, which field under a container references a named volume defined in spec.volumes?