Storage
Drill 12 practice questions focused entirely on Storage for the Linux Foundation CKA exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
A developer creates a PVC named 'cache-data' that dynamically provisions a PV through a StorageClass whose reclaimPolicy is 'Delete'. After testing, the developer deletes the PVC to free resources. A day later, the team asks you to recover the data that was on that volume. Which statement correctly describes what happened and why?
You have created a single PersistentVolume named 'data-pv' with capacity 50Gi, accessModes ReadWriteOnce, and no storageClassName. Two PersistentVolumeClaims are pending: 'claim-a' requests 20Gi ReadWriteOnce, and 'claim-b' requests 20Gi ReadWriteOnce. Both PVCs have no storageClassName set. After a few moments you observe that 'claim-a' is Bound to 'data-pv' but 'claim-b' remains Pending. Why does 'claim-b' stay Pending?
A developer creates a PersistentVolumeClaim requesting 10Gi with accessMode ReadWriteOnce. The cluster has three manually-created PersistentVolumes with no storageClassName set: PV-a (5Gi, ReadWriteOnce, Available), PV-b (20Gi, ReadWriteMany, Available), and PV-c (15Gi, ReadWriteOnce, Available). No StorageClass and no dynamic provisioner exist. Which PV will the PVC bind to?
A stateful application uses a PVC bound to a PV backed by a block-storage CSI driver that only supports ReadWriteOnce. The PVC is currently mounted by a pod running on node worker-1. You scale the Deployment to 2 replicas, and the second pod is scheduled to worker-2 but remains stuck in ContainerCreating. Events on the second pod show a FailedAttachVolume / Multi-Attach error. What is the correct explanation and remedy?
A developer creates a PersistentVolumeClaim requesting 5Gi with accessMode ReadWriteOnce, but the PVC remains stuck in 'Pending' status. The cluster has no manually created PersistentVolumes. You inspect the PVC and notice it does not specify a storageClassName field, and no default StorageClass is configured in the cluster. What is the most likely reason the PVC is not being bound?
You statically provision a PersistentVolume named data-pv with a capacity of 50Gi, accessModes of ReadWriteOnce, and no storageClassName set. A developer then creates a PersistentVolumeClaim requesting 20Gi of storage with ReadWriteOnce and no storageClassName. The PVC binds successfully to data-pv. When the developer runs 'df -h' inside the pod that mounts this PVC, what usable capacity will the mounted volume report for a typical backing filesystem?
A developer created a PVC named 'data-pvc' requesting 5Gi from the 'fast-ssd' StorageClass, and it successfully bound to a dynamically provisioned PV. The application now needs 20Gi. The developer edits the PVC and changes 'spec.resources.requests.storage' to 20Gi, but the change is rejected with an error, and the PVC remains at 5Gi. The 'fast-ssd' StorageClass does NOT have 'allowVolumeExpansion' set. What is the correct way to give the application 20Gi of storage while keeping data loss to a minimum?
A PersistentVolume named 'data-pv' was created with persistentVolumeReclaimPolicy set to Retain. After the bound PVC was deleted by a developer, the underlying storage still contains critical data, but the PV now shows STATUS 'Released' and cannot be bound to a new PVC even though the new PVC requests the same storage class, capacity, and access mode. What must you do to make the existing 'data-pv' bindable again while preserving the data?
You deploy a StatefulSet named 'db' with 3 replicas. Its spec includes a volumeClaimTemplates entry with metadata.name 'data', accessModes ReadWriteOnce, storageClassName 'fast-ssd', and a 10Gi request. The 'fast-ssd' StorageClass supports dynamic provisioning. After the StatefulSet becomes fully ready, how many PersistentVolumeClaims exist and what is their naming pattern?
A developer needs to increase the size of a PersistentVolumeClaim named 'data-pvc' from 5Gi to 20Gi because the application is running out of space. The PVC was dynamically provisioned by a StorageClass named 'fast-ssd' backed by a CSI driver that supports online resizing. When the developer edits the PVC and increases spec.resources.requests.storage to 20Gi, the change is rejected with the error 'persistentvolumeclaims "data-pvc" is forbidden: only dynamically provisioned pvcs can be resized and the storageclass that provisions the pvc must support resize'. What must be done to allow the resize to succeed?
A developer submits a PersistentVolumeClaim that does not specify a storageClassName. The cluster has three StorageClasses defined, but the PVC remains Pending and no PersistentVolume is dynamically provisioned. You run 'kubectl get storageclass' and see that none of the classes shows '(default)' next to its name. What is the most likely cause and correct fix?
You define a StorageClass backed by a topology-constrained CSI driver where volumes can only be attached to nodes in the same availability zone. Developers report that PVCs bind immediately, but Pods using them sometimes fail to schedule because the volume was provisioned in a zone that has no available nodes for the Pod. Which StorageClass setting should you configure to ensure the volume is provisioned in a zone compatible with where the Pod will actually be scheduled?
More CKA practice
Keep going with the other Certified Kubernetes Administrator (CKA) domains, or take a full timed mock exam.
← Back to CKA overview