Kubernetes Container Orchestration Storage Solutions 5 — Questions and Answers
Question 1: What Kubernetes feature allows storage capacity information to be published so the scheduler can make volume-aware placement decisions?
- StorageClass topology keys
- CSIStorageCapacity objects (Correct answer)
- VolumeNodeAffinity hints
- PVCapacityMap
Correct answer: CSIStorageCapacity objects
CSIStorageCapacity objects, created by CSI drivers, expose available capacity per topology segment so the scheduler avoids placing pods where storage would be insufficient.
Question 2: Which kubectl command shows the events associated with a PersistentVolumeClaim to help diagnose binding issues?
- kubectl get pvc -o wide
- kubectl describe pvc <name> (Correct answer)
- kubectl logs pvc/<name>
- kubectl inspect pvc <name>
Correct answer: kubectl describe pvc <name>
kubectl describe pvc shows the full PVC spec, status, and the Events section which lists binding attempts, provisioner errors, and other diagnostic messages.
Question 3: What is the effect of setting 'ReadWriteOncePod' as the access mode for a PersistentVolumeClaim?
- The volume can be mounted by one pod at a time across the entire cluster (Correct answer)
- The volume can be mounted by multiple pods on a single node
- The volume is read-only for all pods except the owner pod
- The volume can be mounted by any pod in the same namespace
Correct answer: The volume can be mounted by one pod at a time across the entire cluster
ReadWriteOncePod (RWOP), introduced in Kubernetes 1.22, ensures the volume is mounted by exactly one pod across the whole cluster, stricter than ReadWriteOnce.
Question 4: In the context of Kubernetes storage, what does 'dynamic provisioning' mean?
- Volumes are pre-created by an administrator and listed in etcd
- A StorageClass provisioner automatically creates a PV when a matching PVC is submitted (Correct answer)
- Pods dynamically resize their volumes based on usage
- Volumes are provisioned at cluster bootstrap and assigned on demand
Correct answer: A StorageClass provisioner automatically creates a PV when a matching PVC is submitted
Dynamic provisioning means a provisioner plugin (in-tree or CSI) automatically creates a PersistentVolume to satisfy a PVC without manual administrator intervention.
Question 5: What must be true for a PersistentVolume to bind to a PersistentVolumeClaim?
- The PV must be in the same namespace as the PVC
- The PV capacity, access mode, and StorageClass must all satisfy the PVC's request (Correct answer)
- The PV and PVC must have matching labels
- The PV must be on the same node as the pod that will use the PVC
Correct answer: The PV capacity, access mode, and StorageClass must all satisfy the PVC's request
Kubernetes binds a PV to a PVC only when the PV's capacity is at least as large as requested, the access modes overlap, and the StorageClass names match.
Question 6: Which field on a PersistentVolume allows administrators to restrict which PVCs can bind to it?
- spec.claimSelector
- spec.claimRef (Correct answer)
- spec.nodeAffinity
- spec.storageClassName
Correct answer: spec.claimRef
spec.claimRef can pre-bind a PV to a specific PVC by namespace and name, preventing other PVCs from consuming it.
Question 7: When a Kubernetes node is drained, what happens to pods using PersistentVolumeClaims?
- Pods are deleted and their PVCs are released
- Pods are evicted and, if managed by a controller, rescheduled on another node where the volume is reattached (Correct answer)
- PVCs are automatically migrated to another node's local storage
- Pods remain running on the drained node until the PVC is manually unmounted
Correct answer: Pods are evicted and, if managed by a controller, rescheduled on another node where the volume is reattached
During a drain, pods are evicted gracefully; controllers like Deployments or StatefulSets reschedule them elsewhere, and the CSI driver reattaches the volume to the new node.
What Kubernetes feature allows storage capacity information to be published so the scheduler can make volume-aware placement decisions?