Courseiva

CCNA Cka Storage Questions

75 of 84 questions · Page 1/2 · Cka Storage topic · Answers revealed

1
MCQeasy

Which of the following is a valid command to create a PersistentVolume named 'pv-demo' using a YAML manifest file named 'pv.yaml'?

A.kubectl create pv -f pv.yaml
B.kubectl apply -f pv.yaml
C.kubectl create persistentvolume -f pv.yaml
D.kubectl run pv-demo --image=pv --restart=Never
AnswerB

This is the correct and standard declarative command to create or update Kubernetes resources, including PersistentVolumes, from a local or remote YAML manifest. It submits the configuration to the Kubernetes API server, which then provisions or updates the resource state accordingly.

Why this answer

`kubectl apply -f pv.yaml` is the standard Kubernetes command to create or update resources from a YAML manifest file. It reads the manifest, which defines a PersistentVolume named 'pv-demo', and sends it to the API server for creation. This command works for any resource type defined in the file, including PersistentVolumes.

Exam trap

The trap here is that candidates often confuse the `kubectl create` subcommand syntax, thinking that `kubectl create pv` or `kubectl create persistentvolume -f` are valid, when in fact `kubectl apply -f` is the correct and most common way to create resources from a manifest file.

How to eliminate wrong answers

Option A is wrong because `kubectl create pv` is not a valid subcommand; the correct subcommand for creating a PersistentVolume is `kubectl create persistentvolume` (or the short form `pv` is not supported under `create`). Option C is wrong because `kubectl create persistentvolume -f pv.yaml` is syntactically incorrect — the `-f` flag is not used with `kubectl create` for resource-specific subcommands; instead, you must use `kubectl create -f pv.yaml` or `kubectl apply -f pv.yaml`. Option D is wrong because `kubectl run` creates a Pod, not a PersistentVolume; the `--image=pv` flag would attempt to pull a non-existent image, and `--restart=Never` only affects Pod restart policy, not resource type.

2
MCQmedium

A DevOps team needs to deploy a stateful application that requires persistent storage with ReadWriteMany access mode across multiple pods running on different nodes. Which Kubernetes resource should they use to provision the storage?

A.A hostPath volume
B.A PersistentVolume with access mode ReadWriteOnce
C.A PersistentVolume with access mode ReadWriteMany
D.An emptyDir volume
AnswerC

A PersistentVolume with access mode ReadWriteMany allows multiple pods across different nodes to simultaneously read and write to the same storage volume, satisfying the stem’s requirement for concurrent access from pods scheduled on distinct nodes. This access mode directly addresses the constraint of multi-node, multi-pod stateful workloads, whereas ReadWriteOnce would restrict access to a single node.

Why this answer

ReadWriteMany (RWX) is the only access mode that allows multiple pods across different nodes to simultaneously read and write to the same persistent storage volume. A PersistentVolume with access mode ReadWriteMany meets the requirement for a stateful application needing concurrent access from pods running on different nodes, typically backed by network filesystems like NFS, GlusterFS, or CephFS.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (RWO) with multi-pod access, but RWO restricts access to a single node, not a single pod, so multiple pods on the same node can share an RWO volume, but pods on different nodes cannot, making it unsuitable for the stated requirement.

How to eliminate wrong answers

Option A is wrong because a hostPath volume mounts a directory from the host node's filesystem into the pod, which does not support multi-node access; pods scheduled on different nodes would see different host directories, and it is not a persistent storage abstraction managed by Kubernetes. Option B is wrong because a PersistentVolume with access mode ReadWriteOnce (RWO) can only be mounted as read-write by a single node at a time, preventing concurrent access from pods on different nodes. Option D is wrong because an emptyDir volume is ephemeral and tied to the pod's lifecycle; it is created empty when a pod starts and is deleted when the pod is removed, providing no persistent storage across pod restarts or multi-node access.

3
Multi-Selectmedium

Which TWO of the following are required for dynamic provisioning of PersistentVolumes using a StorageClass?

Select 2 answers
A.A StorageClass with allowVolumeExpansion: true
B.A StorageClass with volumeBindingMode: WaitForFirstConsumer
C.A PersistentVolumeClaim that references the StorageClass
D.A default StorageClass must be defined
E.A StorageClass with a provisioner defined
AnswersC, E

A PersistentVolumeClaim that references the StorageClass is indeed required for dynamic provisioning. The PVC must set its storageClassName field to the name of a StorageClass that has a provisioner; this reference tells the Kubernetes controller which provisioner should create a PV matching the PVC's requested size and access modes. Without this reference, the PVC either remains pending or binds to a pre-existing statically provisioned PV, but it cannot trigger creation of a new PV.

Why this answer

Option C is correct because dynamic provisioning is triggered by a PersistentVolumeClaim that specifies the StorageClass via its storageClassName field (or relies on the default), which tells Kubernetes to create a matching PersistentVolume on demand. Option E is correct because a StorageClass must define a provisioner (for example, kubernetes.io/aws-ebs or a CSI driver name), since the provisioner is the component that actually creates the backing volume; without it, no dynamic provisioning can occur. Option A is wrong because allowVolumeExpansion only enables resizing of already-provisioned volumes and is not required for provisioning.

Option B is wrong because volumeBindingMode: WaitForFirstConsumer only delays binding until a Pod is scheduled; the default Immediate mode also supports dynamic provisioning. Option D is wrong because a default StorageClass is only needed when a PVC omits storageClassName; a PVC that explicitly references a StorageClass provisions dynamically without any default being defined.

Exam trap

A common misconception is that a default StorageClass is mandatory for dynamic provisioning, but the actual requirement is that the PVC must reference a StorageClass (either explicitly or via the default), and the StorageClass must have a provisioner defined.

4
MCQeasy

Which of the following volume types is designed to store sensitive information such as passwords or tokens?

A.emptyDir
B.hostPath
C.secret
D.configMap
AnswerC

The Secret volume type is specifically designed to store and deliver sensitive data such as passwords, OAuth tokens, and SSH keys to containers. Secret objects are persisted in etcd, subject to RBAC authorization, and can be encrypted at rest via EncryptionConfiguration. When mounted as volumes, they are exposed as files in a tmpfs-backed directory rather than written to persistent disk, reducing data-loss exposure. This makes Secret the intended and secure choice for the 'sensitive data' scenario in the question.

Why this answer

The Secret volume type is specifically designed to store sensitive data such as passwords, tokens, or SSH keys. Secrets are stored in the cluster's etcd (optionally encrypted at rest) and are injected into pods as files or environment variables, with in-memory (tmpfs) mounting to avoid writing sensitive data to disk.

Exam trap

A common pitfall in the CKA exam is confusing ConfigMap with Secret. Candidates often think ConfigMap can store sensitive data because it also holds key-value pairs, but ConfigMap lacks encryption and tmpfs mounting, which are essential for security. Secrets are specifically designed for sensitive information.

How to eliminate wrong answers

Option A is wrong because emptyDir is a temporary volume that shares data between containers in the same pod and is deleted when the pod is removed, with no built-in mechanism for storing sensitive data securely. Option B is wrong because hostPath mounts a file or directory from the host node's filesystem into the pod, which is not designed for secrets and poses security risks by exposing node-level data. Option D is wrong because ConfigMap is intended for non-sensitive configuration data (e.g., environment variables, config files) and does not provide encryption or access control for secrets.

5
Multi-Selecthard

An administrator needs to expand an existing PersistentVolumeClaim. Which TWO conditions must be met?

Select 2 answers
A.The PVC must be currently mounted by at least one pod.
B.The underlying PersistentVolume must be deleted first.
C.The StorageClass used by the PVC must have 'allowVolumeExpansion: true'.
D.The PersistentVolume's reclaim policy must be Recycle.
E.The PVC must be bound to a PersistentVolume.
AnswersC, E

The allowVolumeExpansion field on the StorageClass is the key enabling factor for volume growth. When set to true, the storage provisioner and the external controller permit the PVC's requested size to be increased beyond its original value; without this flag, any edit to the PVC's storage request is rejected, since the storage class provider has not opted into supporting resizing. This setting is per storage class, so if the class lacks it, expansion is impossible regardless of the volume plugin.

Why this answer

The StorageClass must have `allowVolumeExpansion: true` to permit resizing of a PersistentVolumeClaim. This field is a prerequisite in the StorageClass definition; without it, the PVC cannot be expanded even if the underlying volume supports resizing. The CKA exam expects you to know that volume expansion is gated by this StorageClass setting.

Exam trap

The CKA exam often tests the misconception that a PVC must be mounted or that the PV must be deleted before expansion, but the actual requirement is the StorageClass setting and the PVC being bound to a PV.

6
MCQeasy

An administrator needs to create a PersistentVolume with 10Gi capacity, ReadWriteOnce access mode, and a reclaim policy of Retain. Which YAML snippet correctly defines this PV?

A.apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain hostPath: path: /data/pv
B.apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 10Gi accessMode: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /data/pv
C.apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 10Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /data/pv
D.apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 10Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete hostPath: path: /data/pv
AnswerC

This is the correct PersistentVolume manifest because it satisfies all the stated requirements: it declares capacity of 10Gi, uses the plural accessModes field with ReadWriteOnce as a valid single-node access mode, and sets persistentVolumeReclaimPolicy to Retain. The hostPath points to /data/pv, and the PV is available to match a PersistentVolumeClaim that requests up to 10Gi with a compatible access mode. The manifest is structurally and semantically valid under the v1 API.

Why this answer

It defines a PersistentVolume with the required 10Gi capacity, ReadWriteOnce access mode (using the correct plural 'accessModes' field), and the Retain reclaim policy. The hostPath volume type is also specified correctly.

Exam trap

The CKA exam often tests the distinction between the singular 'accessMode' (incorrect) and the plural 'accessModes' (correct) in PersistentVolume and PersistentVolumeClaim specs, causing candidates to pick option B if they overlook this YAML syntax requirement.

How to eliminate wrong answers

Option A is wrong because it uses 'ReadWriteMany' instead of the required 'ReadWriteOnce' access mode. Option B is wrong because it uses the incorrect singular field name 'accessMode' instead of the correct plural 'accessModes'. Option D is wrong because it specifies 'persistentVolumeReclaimPolicy: Delete' instead of the required 'Retain'.

7
MCQhard

Which CSI driver feature must be supported by the driver to allow expanding a PVC while the pod using it is still running?

A.Volume attach
B.Volume expansion
C.Mount options
D.ExpandInUsePersistentVolume
AnswerB

Volume expansion is the correct high-level feature, but the CSIDriver spec requires an explicit mode to enable the in-use aspect. A driver may support expansion only when the volume is detached, declared via ExpandPersistentVolume, and still not allow resize while attached. Thus merely saying 'volume expansion' is too imprecise; Kubernetes must see a specific mode flag to permit online expansion.

Why this answer

To allow expanding a PVC while the pod is still running, the CSI driver must support volume expansion (e.g., ControllerExpandVolume and NodeExpandVolume RPCs). The in-use expansion capability is also controlled by the Kubernetes feature gate `ExpandInUsePersistentVolumes`, but that is not a CSI driver feature. Therefore, the correct answer is 'Volume expansion'.

Exam trap

Candidates may confuse the Kubernetes feature gate `ExpandInUsePersistentVolumes` with a CSI driver capability. The feature gate is a cluster-level setting, while the driver must support volume expansion via its CSI capabilities.

How to eliminate wrong answers

Option A is wrong because 'Volume attach' is a CSI driver capability that controls whether the driver supports attaching volumes to nodes, not expanding them while in use. Option B is wrong because 'Volume expansion' is a generic capability that indicates the driver supports expanding volumes, but it does not specifically allow expansion while the PVC is still mounted by a running pod. Option C is wrong because 'Mount options' is a CSI driver capability that controls whether the driver supports custom mount options, and it has no relation to online volume expansion.

8
Multi-Selectmedium

Which TWO of the following statements about StorageClass are correct? (Select two.)

Select 2 answers
A.A StorageClass must have a provisioner field set to 'kubernetes.io/no-provisioner' to use static provisioning.
B.A StorageClass is a namespaced resource.
C.The reclaimPolicy in a StorageClass defaults to Retain.
D.A StorageClass can be used for dynamic provisioning of PersistentVolumes.
E.A StorageClass can specify a volumeBindingMode, which can be Immediate or WaitForFirstConsumer.
AnswersD, E

A StorageClass enables dynamic provisioning by specifying a provisioner name that creates a PersistentVolume automatically when a PersistentVolumeClaim referencing that class is submitted. The provisioner, such as ebs.csi.aws.com or rbd.csi.ceph.com, invokes the storage backend to allocate new storage, and the resulting PV is then bound to the PVC.

Why this answer

Option D is correct because a StorageClass defines a provisioner (for example, kubernetes.io/aws-ebs or a CSI driver) that Kubernetes uses to dynamically provision PersistentVolumes when a PersistentVolumeClaim requests that class, so it is the standard mechanism for dynamic provisioning. Option E is correct because StorageClass supports the volumeBindingMode field, whose valid values are Immediate and WaitForFirstConsumer; WaitForFirstConsumer delays binding until a Pod using the PVC is scheduled, which is essential for topology-aware volumes. Option A is wrong because 'kubernetes.io/no-provisioner' is only used for the special case of local static volumes, not a general requirement for static provisioning, and static PVs are typically matched to PVCs by capacity, access modes, and selector rather than by a no-provisioner StorageClass.

Option B is wrong because StorageClass is a cluster-scoped resource, not namespaced. Option C is wrong because the default reclaimPolicy for a dynamically provisioned volume is Delete, not Retain.

Exam trap

The trap here is that candidates often confuse StorageClass as a namespaced resource (Option B) because many Kubernetes resources (e.g., PVCs, ConfigMaps) are namespaced, but StorageClass is cluster-scoped; also, they may mistakenly think the default reclaimPolicy is 'Retain' (Option C) when it is actually 'Delete'.

9
MCQmedium

A new StorageClass 'fast' is created with volumeBindingMode: WaitForFirstConsumer. A PVC using this StorageClass is created but no pod consumes it. What is the state of the PVC immediately after creation?

A.Bound
B.Pending
C.Lost
D.The PVC will not be created
AnswerB

The PVC will remain in the Pending state because the WaitForFirstConsumer mode instructs the volume controller to defer volume creation. This delay ensures that the PV is provisioned in a topology (like a specific availability zone) compatible with the node where the Pod is scheduled. Once the Pod is assigned to a node, the PV is provisioned and the PVC transitions to Bound.

Why this answer

When a StorageClass uses volumeBindingMode: WaitForFirstConsumer, the PVC will remain in a Pending state until a pod that uses it is scheduled. This is because the volume binding and provisioning are deferred until the first consumer (pod) is created, allowing the scheduler to consider the pod's node constraints when selecting the volume. Since no pod consumes the PVC immediately after creation, it stays Pending.

Exam trap

The trap here is that candidates assume a PVC with a StorageClass will immediately bind to a dynamically provisioned PV, but WaitForFirstConsumer explicitly defers binding until a pod is scheduled, making Pending the correct state.

How to eliminate wrong answers

Option A is wrong because Bound would require the PV to be provisioned and bound to the PVC, which does not happen until a pod consumes it with WaitForFirstConsumer. Option C is wrong because Lost indicates that the PV was previously bound but is no longer available, which is not the case here as no binding occurred. Option D is wrong because the PVC is created successfully; it simply remains in a Pending state until a pod triggers binding.

10
MCQhard

A StatefulSet named 'web' uses volumeClaimTemplates to create a PVC named 'data' with storage class 'ssd'. The StatefulSet has 3 replicas. After scaling down to 2 replicas, what happens to the PVC of the third pod (web-2)?

A.The PVC is detached but not deleted
B.The PVC remains and must be manually deleted if not needed
C.The PVC's reclaim policy determines its fate
D.The PVC is automatically deleted along with the pod
AnswerB

Kubernetes intentionally preserves PersistentVolumeClaims created by StatefulSet VolumeClaimTemplates to prevent accidental data loss during scale-down operations. Because the lifecycle of the PVC is decoupled from the individual Pod lifecycle, an administrator must explicitly delete the PVCs manually if the data is no longer required. This safety mechanism ensures stateful data is never deleted without explicit administrative intent.

Why this answer

When a StatefulSet is scaled down, the associated pods are terminated, but the PVCs created via volumeClaimTemplates are not automatically deleted. This is by design to prevent accidental data loss, as the PVCs may contain stateful data that should persist even if the pod is removed. Therefore, the PVC for web-2 remains in the cluster and must be manually deleted if it is no longer needed.

Exam trap

The trap here is that candidates often assume PVCs are ephemeral like pods or that the reclaim policy controls PVC lifecycle, but in StatefulSets, PVCs persist after pod deletion to preserve state, and only manual deletion or a separate cleanup process removes them.

How to eliminate wrong answers

Option A is wrong because the PVC is not 'detached' — it remains bound to its PV and is simply not in use by any pod; the concept of detachment is not applicable here. Option C is wrong because the PVC's reclaim policy applies to the underlying PersistentVolume when the PVC is deleted, not to the PVC itself when the pod is removed; the PVC persists regardless of the reclaim policy. Option D is wrong because StatefulSets do not automatically delete PVCs when pods are scaled down; this is a deliberate design choice to protect stateful data.

11
MCQhard

You create a StorageClass with volumeBindingMode: WaitForFirstConsumer. A PVC using this StorageClass is created but remains in 'Pending' state. The PVC expects a node with label 'disktype=ssd'. A suitable node exists. What is the MOST likely reason the PVC is still Pending?

A.The node selector on the PVC is incorrect.
B.The PVC requests a storage size larger than available.
C.No pod has been created that uses this PVC.
D.The persistentVolumeReclaimPolicy is set to Retain.
AnswerC

No pod has been created that uses this PVC, which is the defining characteristic of WaitForFirstConsumer. The storage controller intentionally defers PV binding and dynamic provisioning until a pod is scheduled, because it needs to know the pod's node and zone to select an appropriately local volume. Until that consumer exists, the PVC correctly remains in the Pending state.

Why this answer

With volumeBindingMode: WaitForFirstConsumer, the PVC will not be bound to a PV until a pod that uses the PVC is scheduled. The PVC remains Pending because no pod has been created that references it, even though a matching node exists. The scheduler defers volume binding to ensure the PV is provisioned on the same node where the pod lands.

Exam trap

The trap here is that candidates assume a PVC will bind immediately if a matching node exists, overlooking that WaitForFirstConsumer deliberately delays binding until a pod consumes the PVC.

How to eliminate wrong answers

Option A is wrong because the node selector on the PVC is correct (a node with 'disktype=ssd' exists), so the PVC's selector is not the issue. Option B is wrong because there is no indication that the requested storage size exceeds available capacity; the PVC is Pending due to the binding mode, not capacity. Option D is wrong because persistentVolumeReclaimPolicy (Retain, Delete, or Recycle) affects what happens to a PV after a PVC is released, not whether a PVC can bind to a PV.

12
Multi-Selectmedium

Which TWO of the following are valid reclaim policies for a PersistentVolume? (Select TWO)

Select 2 answers
A.Retain
B.Delete
C.Recycle
D.Preserve
E.Archive
AnswersA, B

The Retain reclaim policy directs Kubernetes to leave the underlying storage volume and its data completely untouched when a bound PersistentVolumeClaim is deleted. The PV then transitions to the Released phase, and an administrator must manually inspect, clean up, or repurpose the storage asset before the PV can be made Available again. This is the safest choice for data that must be preserved for compliance or recovery, but it requires deliberate manual intervention to reclaim the volume.

Why this answer

A is correct because the Retain reclaim policy is one of the two valid policies for PersistentVolumes in Kubernetes. When a PersistentVolume is released from its claim, the Retain policy leaves the volume and its data intact, requiring manual administrator intervention to reclaim the storage. This is defined in the PersistentVolume spec under the `persistentVolumeReclaimPolicy` field.

Exam trap

The trap here is that candidates may recall Recycle as a valid policy from older Kubernetes documentation or experience, but the CKA exam focuses on current Kubernetes versions (1.27+) where Recycle is no longer supported, making Retain and Delete the only correct choices.

13
MCQmedium

A developer creates a YAML manifest for a pod that uses a PersistentVolumeClaim. The PVC requests 5Gi of storage but the only available PV has 10Gi. What will happen when the pod is created?

A.The PV will be resized to 5Gi to match the PVC.
B.The PVC will bind to the PV and the pod will run.
C.The PVC will not bind and the pod will remain Pending.
D.The PVC will bind but the pod will be OOMKilled.
AnswerB

The PVC binds to the PV because the PV's capacity is greater than the requested storage, which Kubernetes allows. Once bound, the pod's volume mount is fulfilled and the pod can schedule and run normally. The PV capacity just needs to be equal to or larger than the PVC request, along with satisfying access modes and storage class.

Why this answer

PersistentVolumeClaims (PVCs) bind to PersistentVolumes (PVs) based on satisfying the requested storage size and access modes. Kubernetes allows a PVC to bind to a PV that has equal or greater capacity than requested; the PVC will consume only its requested amount (5Gi) from the larger PV (10Gi). Once bound, the pod referencing the PVC can start successfully because the storage claim is satisfied.

Exam trap

The trap here is that candidates often assume the PVC must match the PV exactly in size, leading them to incorrectly choose that the PVC will not bind and the pod will remain Pending.

How to eliminate wrong answers

Option A is wrong because Kubernetes does not dynamically resize PVs to match PVC requests; PVs are static resources and their capacity is immutable after creation. Option C is wrong because a PVC can bind to a PV with larger capacity, so the binding will succeed and the pod will not remain Pending due to storage. Option D is wrong because OOMKilled is a pod termination due to memory exhaustion, which is unrelated to storage binding; the PVC binding does not cause out-of-memory errors.

14
MCQmedium

An administrator runs 'kubectl get pvc' and sees a PVC with status 'Lost'. What does this status indicate?

A.The PVC requested more storage than the available PV can provide
B.The pod using the PVC has been deleted
C.The PVC's storage class does not match any available PV
D.The PV that was bound to the PVC has been deleted or is no longer available
AnswerD

The Lost phase specifically indicates that a previously bound relationship has been broken because the underlying PersistentVolume was deleted from the cluster or is no longer accessible. Kubernetes updates the PVC's status to Lost to signal that the bound storage resource is missing, even though the claim object itself still exists.

Why this answer

A PVC with status 'Lost' indicates that the PersistentVolume (PV) it was bound to has been deleted or is no longer available. This breaks the binding between the PVC and the PV, leaving the PVC in a state where it cannot be used until the PV is restored or the PVC is recreated. The 'Lost' status is specific to this scenario and does not occur due to size mismatches, pod deletion, or storage class issues.

Exam trap

The trap here is that candidates confuse 'Lost' with 'Pending' or 'Failed', assuming it relates to resource constraints or pod lifecycle, rather than understanding it specifically indicates the bound PV has been removed.

How to eliminate wrong answers

Option A is wrong because a PVC requesting more storage than available PVs can provide results in a 'Pending' status, not 'Lost', as the PVC waits for a suitable PV to become available. Option B is wrong because deleting a pod that uses a PVC does not change the PVC's status; the PVC remains bound and available for other pods. Option C is wrong because a storage class mismatch between PVC and PV also leads to a 'Pending' status, as the system cannot find a matching PV, not 'Lost'.

15
MCQmedium

A cluster administrator creates a PersistentVolume with the following YAML: apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 1Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /data/pv A user creates a PersistentVolumeClaim requesting 500Mi with access mode ReadWriteOnce and no storage class. The PVC remains in Pending state. What is the most likely cause?

A.The PV's reclaim policy is Retain, so it is in Released state and cannot be bound to a new PVC.
B.The cluster has a default StorageClass defined, causing the PVC to attempt dynamic provisioning instead of binding to this static PV.
C.The hostPath path /data/pv does not exist on any node in the cluster.
D.The PVC requests 500Mi, but the PV has 1Gi capacity, which is larger than requested, so the PVC cannot bind to it.
AnswerB

When a default StorageClass is configured in the cluster, any PVC that does not explicitly specify a storageClassName will automatically default to that StorageClass. This triggers the dynamic provisioning workflow, causing the control plane to ignore pre-created static PVs that do not have a matching storageClassName or are configured with a different class.

Why this answer

When a default StorageClass exists in the cluster, a PVC with no storage class name specified will automatically trigger dynamic provisioning via that default StorageClass, rather than attempting to bind to an existing static PV. This causes the PVC to remain in Pending state if the dynamic provisioner cannot fulfill the request (e.g., due to missing CSI driver or cloud provider configuration). The static PV pv-example is ignored because the PVC's provisioning mechanism is overridden by the default StorageClass.

Exam trap

In CKA exams, a common pitfall is that when a default StorageClass exists, PVCs without a storage class name will use dynamic provisioning instead of binding to an existing static PV, causing the PVC to remain in Pending state if the provisioner is not properly configured.

How to eliminate wrong answers

Option A is wrong because the PV's reclaim policy of Retain only affects what happens to the underlying storage after the PV is released from a claim; it does not prevent a PV in Available state from binding to a new PVC. Option C is wrong because the hostPath path /data/pv does not need to pre-exist for the PV to be created or bound; hostPath PVs are node-specific and the path is created on demand by Kubernetes if it does not exist. Option D is wrong because a PVC can bind to a PV with larger capacity; Kubernetes allows binding as long as the PVC's requested size is less than or equal to the PV's capacity.

16
MCQmedium

An administrator applies the following YAML: --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: "" --- What does setting storageClassName to an empty string achieve?

A.It disables storage for the PVC
B.It ensures the PVC binds only to a PV with no storage class defined
C.It triggers dynamic provisioning using the default StorageClass
D.It assigns the default StorageClass automatically
AnswerB

When storageClassName is explicitly set to an empty string, Kubernetes restricts the binding process to PersistentVolumes that also have their storageClassName set to an empty string or omitted entirely. This behavior prevents the PVC from binding to any PV associated with a specific StorageClass, ensuring strict matching with statically created, classless PVs.

Why this answer

Setting `storageClassName` to an empty string (`""`) explicitly tells Kubernetes to bind the PVC only to a PV that also has no `storageClassName` defined (i.e., a static PV with an empty or omitted storage class). This bypasses any default StorageClass in the cluster, preventing dynamic provisioning and ensuring the PVC matches only pre-provisioned PVs with no storage class.

Exam trap

The trap here is that candidates often confuse an empty string with omitting the field entirely, but omitting it triggers the default StorageClass, while an empty string explicitly prevents any default from being used.

How to eliminate wrong answers

Option A is wrong because setting `storageClassName` to an empty string does not disable storage for the PVC; the PVC can still bind to a static PV with no storage class. Option C is wrong because an empty string explicitly prevents dynamic provisioning; dynamic provisioning requires a valid StorageClass name or leaving the field unset to use the default. Option D is wrong because an empty string overrides the default StorageClass, preventing automatic assignment; the default is only applied when `storageClassName` is omitted entirely.

17
MCQhard

A cluster administrator needs to provide storage to a pod that must read and write files, but the data does not need to persist beyond the pod's lifecycle. Which volume type should be used?

A.hostPath
B.emptyDir
C.configMap
D.PersistentVolumeClaim
AnswerB

An emptyDir volume is created when a Pod is assigned to a node and exists solely for the lifetime of that Pod on that node. It provides a clean, read-write directory that is automatically deleted when the Pod terminates, making it the ideal choice for transient scratch space, multi-container sharing, or caching. Since the data does not need to survive Pod deletion, this lightweight, ephemeral storage mechanism perfectly satisfies the requirements.

Why this answer

B is correct because emptyDir creates an empty volume that is provisioned when a pod is assigned to a node and exists as long as the pod is running. It allows both reading and writing files, and its contents are deleted when the pod is removed, matching the requirement that data does not need to persist beyond the pod's lifecycle.

Exam trap

The trap here is that candidates often confuse emptyDir with hostPath, thinking both provide temporary storage, but hostPath persists on the node and can cause data leakage or node-specific issues, while emptyDir is truly ephemeral and tied to the pod's lifecycle.

How to eliminate wrong answers

Option A is wrong because hostPath mounts a file or directory from the host node's filesystem into the pod, and data persists on the node even after the pod is deleted, which violates the requirement that data does not need to persist beyond the pod's lifecycle. Option C is wrong because configMap is designed to inject configuration data as files or environment variables, and while it can be mounted as a volume, it is read-only by default and not intended for read/write file storage. Option D is wrong because PersistentVolumeClaim is used to request persistent storage that outlives the pod, which directly contradicts the requirement that data does not need to persist beyond the pod's lifecycle.

18
Multi-Selectmedium

Which TWO statements about emptyDir volumes are correct?

Select 2 answers
A.An emptyDir volume is created empty when a Pod is assigned to a node.
B.An emptyDir volume can be shared between Pods on different nodes.
C.An emptyDir volume persists across pod restarts.
D.An emptyDir volume is deleted when the Pod is removed from the node.
E.An emptyDir volume requires a PersistentVolume.
AnswersA, D

When the kubelet binds a Pod to a node, it creates the emptyDir as a genuinely empty directory in the Pod's sandbox before any container starts. No PersistentVolume, storage class, or pre-populated data is involved; the volume is simply a local directory whose entire lifecycle is the Pod's lifetime on that node. For memory-backed emptyDir, it is an empty tmpfs mount instead.

Why this answer

An emptyDir volume is created as an empty directory on the node when a Pod is first assigned to that node. It requires no pre-existing storage and is provisioned on the node's local filesystem (or memory if type is 'Memory').

Exam trap

The trap here is confusing 'container restart' with 'Pod removal' — candidates often think emptyDir is deleted on container restart, but it persists across container restarts and is only deleted when the Pod is deleted from the node.

19
MCQmedium

A Pod is configured with a volume that uses a ConfigMap. The ConfigMap is updated after the Pod is running. How can the Pod access the updated data without restarting?

A.The ConfigMap must be deleted and recreated.
B.The Node must be rebooted.
C.The Pod will automatically see the updated data within minutes.
D.The Pod must be deleted and recreated.
AnswerC

When a ConfigMap is mounted as a standard volume, the kubelet periodically synchronizes the local files on the node with the updated API resource. This reconciliation loop occurs automatically, typically within a few minutes, depending on the kubelet's sync period and cache propagation delay, without requiring any manual intervention.

Why this answer

When a ConfigMap is mounted into a Pod as a volume (without using subPath), updates to the ConfigMap are automatically reflected in the Pod's filesystem after a short delay (typically within minutes, controlled by the kubelet's sync period). However, if the ConfigMap is consumed via environment variables or mounted using subPath, the Pod must be restarted to see the changes. In this question, the volume uses a ConfigMap (presumably without subPath), so the Pod will automatically see the updated data within minutes.

Exam trap

The CKA exam often tests the misconception that ConfigMap updates require a Pod restart, but the trap here is that candidates forget that volume mounts are automatically updated by the kubelet, while environment variable references are not.

How to eliminate wrong answers

Option A is wrong because deleting and recreating the ConfigMap would cause the Pod to lose access to the volume until the new ConfigMap is created, and the Pod would still need to be restarted to remount the volume; the correct behavior is that the kubelet automatically updates the mount. Option B is wrong because rebooting the Node is unnecessary and disruptive; the kubelet handles ConfigMap updates in-memory without requiring a node reboot. Option D is wrong because deleting and recreating the Pod is not required; the kubelet automatically propagates ConfigMap updates to the mounted volume within the sync period (default 60 seconds) without Pod restart.

20
Multi-Selectmedium

Which TWO of the following are valid reclaim policies for a PersistentVolume?

Select 2 answers
A.Snapshot
B.Reuse
C.Retain
D.Delete
E.Archive
AnswersC, D

Retain is correct because it instructs Kubernetes to keep the PersistentVolume and its underlying data after the PVC is deleted. The PV remains in the Released phase and is not automatically available for a new PVC, which protects the data from accidental deletion. An administrator must manually clean up the volume, remove or update the claimRef, and then decide whether to reuse or destroy it.

Why this answer

The `Retain` reclaim policy is one of the three valid policies for a PersistentVolume in Kubernetes. When a PersistentVolumeClaim is deleted, a PV with `Retain` policy will not be automatically reclaimed; instead, the volume remains in a `Released` state, preserving its data for manual administrator intervention.

Exam trap

The trap here is that candidates confuse the `Retain` policy with backup or archival concepts, or mistakenly think `Snapshot` or `Archive` are valid reclaim policies, when Kubernetes only supports `Retain`, `Delete`, and the deprecated `Recycle`.

21
MCQmedium

A StatefulSet named 'web' uses volumeClaimTemplates to dynamically provision PersistentVolumeClaims for each replica. The cluster runs on AWS with the EBS CSI driver. How many PersistentVolumeClaims will be created if the StatefulSet has 3 replicas and the volumeClaimTemplates specify a single template?

A.9
B.1
C.Depends on the storage class
D.3
AnswerD

Because the StatefulSet is configured with three replicas and a single volume claim template, the StatefulSet controller automatically generates exactly three distinct PVCs, one for each pod (named web-0, web-1, and web-2). Each PVC is uniquely bound to its corresponding pod replica to ensure stable, persistent storage across pod rescheduling and restarts. This one-to-one mapping guarantees that each stateful instance maintains its own independent data state.

Why this answer

A StatefulSet with 3 replicas and a single volumeClaimTemplate creates one PersistentVolumeClaim per replica, resulting in exactly 3 PVCs. Each replica gets its own PVC based on the template, and the EBS CSI driver provisions a distinct EBS volume for each PVC, independent of the storage class configuration.

Exam trap

The trap here is that candidates may think the number of PVCs depends on the storage class or that multiple templates multiply the count per replica, but the CKA exam tests that a single volumeClaimTemplate with N replicas yields exactly N PVCs.

How to eliminate wrong answers

Option A is wrong because it incorrectly assumes multiple PVCs per replica (e.g., 3 per replica), but a single volumeClaimTemplate produces exactly one PVC per replica, not three. Option B is wrong because it suggests only one PVC is created for the entire StatefulSet, but StatefulSets with volumeClaimTemplates create a unique PVC for each replica, not a shared one. Option C is wrong because the storage class only affects the provisioner and volume parameters (e.g., performance, encryption), not the number of PVCs created; the count is determined solely by the number of replicas and templates.

22
Multi-Selectmedium

Which TWO statements about PersistentVolume (PV) reclaim policies are correct?

Select 2 answers
A.Retain: The PV remains in the cluster and must be manually reclaimed.
B.Retain: The underlying storage asset is automatically deleted.
C.Recycle: The PV is automatically cleaned and made available for a new claim.
D.Delete: The PV must be manually deleted by the administrator.
E.Delete: The PV and the associated storage asset are automatically deleted.
AnswersA, E

Retain is correct because the PersistentVolume object remains in the cluster after its PVC is released, transitioning to the Released phase rather than being automatically removed. The underlying storage asset is preserved intact, and an administrator must manually reclaim it, typically by deleting the PV or clearing the claimRef so the volume can be reused under a new claim.

Why this answer

The Retain reclaim policy leaves the PersistentVolume (PV) in the cluster in a 'Released' state after the PersistentVolumeClaim (PVC) is deleted. The underlying storage asset (e.g., an EBS volume or NFS export) is not touched by Kubernetes, and the administrator must manually delete the PV object and then handle the storage asset (e.g., reuse or delete it) outside of Kubernetes.

Exam trap

The trap here is that candidates confuse Retain with automatic cleanup or think Recycle is still a valid, active policy, when in fact it has been deprecated and removed in recent Kubernetes versions.

23
MCQeasy

What is the default reclaim policy for a PersistentVolume?

A.Recycle
B.None
C.Retain
D.Delete
AnswerC

The Retain reclaim policy is the default behavior for manually created PersistentVolumes. When a PersistentVolumeClaim is deleted, the PersistentVolume still exists and is marked as Released, preserving all data on the external storage asset so that an administrator can manually recover, clean, or reuse the volume.

Why this answer

The default reclaim policy for a PersistentVolume (PV) in Kubernetes is 'Retain'. This means that when a PersistentVolumeClaim (PVC) bound to the PV is deleted, the PV will not be automatically deleted or recycled; instead, it remains in a 'Released' state, preserving the underlying storage and data for manual administrator intervention. This is defined in the PV's spec.persistentVolumeReclaimPolicy field, which defaults to 'Retain' if not explicitly set.

Exam trap

The trap here is that candidates often confuse the default reclaim policy with 'Delete' because many cloud-provisioned StorageClasses set reclaimPolicy: Delete by default, but the PV itself defaults to 'Retain' when created statically or without a StorageClass.

How to eliminate wrong answers

Option A is wrong because 'Recycle' is a deprecated reclaim policy that was used to scrub and reuse the volume, but it is not the default and has been removed from Kubernetes as of v1.20. Option B is wrong because there is no 'None' reclaim policy; the valid policies are Retain, Recycle (deprecated), and Delete. Option D is wrong because 'Delete' is not the default; it is an optional policy that automatically removes the underlying storage asset (e.g., AWS EBS volume) when the PVC is deleted, but it must be explicitly configured.

24
MCQmedium

An administrator creates a PersistentVolume named 'pv-nfs' with a reclaim policy of 'Retain'. After a user deletes the PVC bound to this PV, what state does the PV enter?

A.Available
B.Failed
C.Bound
D.Released
AnswerD

Under the Retain reclaim policy, deleting the PVC leaves the actual storage asset intact along with all its data, transitioning the PV's status to Released. This phase explicitly signals to the cluster that the volume is no longer bound to a claim, but still contains sensitive or valuable data that must be manually managed or reclaimed by an administrator before it can be reused.

Why this answer

When a PVC bound to a PV with a reclaim policy of 'Retain' is deleted, the PV does not automatically become available for reuse. Instead, it enters the 'Released' state, indicating that the volume's data is still intact but the PV is no longer bound to a claim. The administrator must manually intervene to reclaim or delete the underlying storage before the PV can be made available again.

Exam trap

The trap here is that candidates often confuse 'Released' with 'Available', assuming the PV automatically becomes reusable after PVC deletion, but 'Retain' policy explicitly prevents automatic reclamation to protect data.

How to eliminate wrong answers

Option A is wrong because 'Available' is the state for a PV that has never been bound or has been manually reclaimed after release; a PV with 'Retain' policy does not automatically become Available upon PVC deletion. Option B is wrong because 'Failed' is a state indicating a volume has encountered an unrecoverable error, not the expected transition after PVC deletion. Option C is wrong because 'Bound' is the state when a PV is actively associated with a PVC; after PVC deletion, the binding is removed, so the PV cannot remain Bound.

25
MCQhard

A PersistentVolume is created with the following spec: persistentVolumeReclaimPolicy: Retain claimRef: namespace: default name: my-pvc After the PVC 'my-pvc' is deleted, what happens to the PV?

A.The PV enters Released state and must have its claimRef manually removed to be reused
B.The PV is automatically deleted
C.The PV remains Available and can be bound to a new PVC
D.The PV is recycled and its contents are wiped
AnswerA

Under the Retain reclaim policy, deleting a PersistentVolumeClaim does not delete the underlying PersistentVolume. Instead, the PV transitions to the Released phase, preserving its data. To make this volume eligible for binding to a new PVC, an administrator must manually edit the PV spec to remove the claimRef block, which still points to the deleted PVC.

Why this answer

When a PersistentVolume (PV) has a reclaim policy of 'Retain' and its bound PVC is deleted, the PV enters the 'Released' state. It is not automatically deleted or recycled; instead, its data is preserved but the PV cannot be reused until the `claimRef` field is manually removed by an administrator. This is because the `claimRef` still references the deleted PVC, preventing automatic re-binding.

Exam trap

The trap here is that candidates often assume a 'Released' PV automatically becomes 'Available' for reuse, but Kubernetes requires manual intervention to clear the `claimRef` before the PV can be bound to a new PVC.

How to eliminate wrong answers

Option B is wrong because a PV with `persistentVolumeReclaimPolicy: Retain` is never automatically deleted upon PVC deletion; only PVs with a `Delete` policy are automatically deleted. Option C is wrong because the PV does not become 'Available'; it enters the 'Released' state and cannot be bound to a new PVC until the `claimRef` is manually cleared. Option D is wrong because recycling (wiping contents) only occurs with the `Recycle` reclaim policy, which is deprecated; the `Retain` policy explicitly preserves data.

26
MCQeasy

A pod is configured to use a PersistentVolumeClaim (PVC). The PVC is bound to a PersistentVolume (PV) that uses a cloud disk. The pod fails to start with the error 'MountVolume.SetUp failed for volume ... mount failed: exit status 32'. What is the most likely cause?

A.The PV's access mode is ReadOnlyMany
B.The PV is not created
C.The PVC is unbound
D.The underlying storage device is still attached to a previous node
AnswerD

Cloud provider disks, such as AWS EBS, GCE Persistent Disk, and Azure Managed Disk, are typically block devices that can be attached to only one node at a time. When a pod using such a PVC is rescheduled or evicted from a previous node, the old kubelet must detach the volume, and Kubernetes' attach/detach controller must mark it as unattached before the new node can attach it. If that detach is still in progress or failed, the new kubelet's mount attempt fails with an error such as 'Multi-Attach error for volume' or 'volume is still attached to node'. This is a transient but common cause of mount failures in environments using ReadWriteOnce volumes, and it is distinct from access-mode or binding problems.

Why this answer

The error 'MountVolume.SetUp failed for volume ... mount failed: exit status 32' typically indicates a filesystem-level mount failure. When a cloud disk (e.g., AWS EBS, GCE PD) is still attached to a previous node, the new node cannot mount it because the disk is already in use or has a stale filesystem lock. Kubernetes requires the disk to be detached from the old node before it can be attached and mounted on the new node.

Exam trap

The trap here is that candidates often assume the error is due to a missing PV or unbound PVC, but the specific 'exit status 32' points to a low-level mount failure, typically caused by the disk still being attached to a previous node.

How to eliminate wrong answers

Option A is wrong because ReadOnlyMany access mode would not cause a mount failure with exit status 32; it would allow the pod to mount the volume as read-only, and the error would be different (e.g., permission denied). Option B is wrong because if the PV were not created, the PVC would remain unbound and the pod would fail with a different error (e.g., 'persistentvolumeclaim not found') rather than a mount failure. Option C is wrong because an unbound PVC would prevent the pod from scheduling or starting with an error about the PVC not being bound, not a mount failure with exit status 32.

27
MCQmedium

An administrator needs to expand a PersistentVolumeClaim (PVC) that is currently bound to a PersistentVolume (PV). The PV is provisioned by a storage class that supports volume expansion. What must the administrator do to increase the PVC's storage size?

A.Delete the pod that uses the PVC and recreate it with a larger claim.
B.Edit the PV's capacity and then the PVC's capacity.
C.Delete the PVC and recreate it with a larger size.
D.Update the PVC's spec.resources.requests.storage to a larger value.
AnswerD

Increasing the value of spec.resources.requests.storage in the PVC manifest is the standard, declarative way to trigger volume expansion in Kubernetes. For this operation to succeed, the underlying StorageClass must have the allowVolumeExpansion field set to true. Once updated, the control plane coordinates with the CSI driver to resize the physical volume and subsequently expand the file system on the node.

Why this answer

Kubernetes supports expanding PersistentVolumeClaims (PVCs) if the underlying StorageClass has `allowVolumeExpansion: true`. The administrator only needs to edit the PVC's `spec.resources.requests.storage` field to a larger value; the system automatically triggers the expansion of the bound PersistentVolume (PV) and the actual storage backend, provided the volume driver supports it. No pod deletion or PVC recreation is required.

Exam trap

The trap here is that candidates mistakenly think they must delete the PVC or PV to change storage size, but Kubernetes allows in-place expansion via PVC spec update when the StorageClass supports it.

How to eliminate wrong answers

Option A is wrong because deleting and recreating the pod does not change the PVC's size; the PVC must be updated directly, and the pod can continue using the expanded volume without recreation. Option B is wrong because editing the PV's capacity is not allowed—PVs are immutable after creation, and the PVC expansion must be initiated by updating the PVC, not the PV. Option C is wrong because deleting the PVC would cause data loss and require re-provisioning a new PV; Kubernetes supports online expansion without destroying the existing claim.

28
MCQmedium

An application requires a persistent volume that can be shared across multiple Pods running on different nodes, with read-write access from all Pods simultaneously. Which access mode should be specified in the PersistentVolumeClaim?

A.ReadWriteOncePod
B.ReadOnlyMany
C.ReadWriteOnce
D.ReadWriteMany
AnswerD

ReadWriteMany (RWX) is the access mode that allows the volume to be mounted as read-write on many nodes simultaneously, enabling any number of Pods across the cluster to access it concurrently. This matches the requirement of a persistent volume that can be shared: all replicas can read and write the same data without a single-node limitation. Storage backends like NFS, SMB, or certain cloud volumes support RWX.

Why this answer

The correct access mode is ReadWriteMany (RWX), which allows the volume to be mounted as read-write by multiple Pods across different nodes simultaneously. This matches the requirement for shared concurrent read-write access from all Pods.

Exam trap

The trap here is that candidates often confuse ReadWriteMany with ReadWriteOnce, assuming that 'once' means 'one Pod' rather than 'one node', or they forget that ReadOnlyMany does not grant write access despite allowing multi-Pod mounting.

How to eliminate wrong answers

Option A is wrong because ReadWriteOncePod restricts the volume to a single Pod on a single node, preventing sharing. Option B is wrong because ReadOnlyMany allows multiple Pods to mount the volume but only in read-only mode, not read-write. Option C is wrong because ReadWriteOnce allows only a single node to mount the volume as read-write, blocking multi-node sharing.

29
MCQmedium

A user creates a PersistentVolumeClaim with a storage class 'ssd' that does not exist in the cluster. What will happen when the PVC is created?

A.The PVC will be deleted automatically after a timeout.
B.The PVC will be automatically bound to any available PV.
C.The PVC will remain in Pending state.
D.The cluster will create the storage class automatically.
AnswerC

When a PersistentVolumeClaim (PVC) is created referencing a StorageClass that does not exist within the cluster, the dynamic provisioning mechanism cannot proceed. The Kubernetes control plane is unable to locate a provisioner associated with the specified, non-existent StorageClass to create a new PersistentVolume (PV). Consequently, the PVC will remain in a `Pending` state indefinitely, waiting for a matching PV to become available or for the specified StorageClass to be created.

Why this answer

When a PersistentVolumeClaim (PVC) references a StorageClass that does not exist in the cluster, the PVC cannot be dynamically provisioned because the provisioner associated with that StorageClass is missing. Without a matching StorageClass, the system cannot create a new PersistentVolume (PV) for the PVC, and since no existing PV matches the claim (or the PVC is set to use dynamic provisioning), the PVC will remain in a Pending state indefinitely until the StorageClass is created or the PVC is deleted.

Exam trap

The trap here is that candidates often assume Kubernetes will fall back to a default StorageClass or automatically bind to an existing PV, but the system strictly requires the specified StorageClass to exist for dynamic provisioning and will not bypass this check.

How to eliminate wrong answers

Option A is wrong because PVCs are not automatically deleted after a timeout; they remain in Pending state until the underlying issue (missing StorageClass) is resolved or the PVC is manually deleted. Option B is wrong because a PVC that specifies a non-existent StorageClass cannot be bound to any available PV unless there is a PV that exactly matches the PVC's storage class label (which would require the StorageClass to exist), and the default binding behavior does not override a missing StorageClass. Option D is wrong because Kubernetes does not automatically create StorageClasses; they must be explicitly defined by a cluster administrator, and the system will not generate a StorageClass on the fly.

30
MCQeasy

An administrator creates a PersistentVolume with the following YAML: ```yaml apiVersion: v1 kind: PersistentVolume metadata: name: pv-example spec: capacity: storage: 5Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /mnt/data ``` Which of the following is true about this PersistentVolume?

A.It can be mounted as read-write by only one node at a time.
B.It can be mounted as read-write by multiple nodes simultaneously.
C.The PV will be automatically deleted when its PVC is released.
D.The PV supports dynamic provisioning.
AnswerA

The ReadWriteOnce (RWO) access mode restricts volume mounting to a single Kubernetes node for read-write operations. While multiple pods scheduled on that same node can access the volume concurrently, pods on different nodes cannot attach to it simultaneously. This ensures data integrity by preventing multi-node write conflicts on block storage.

Why this answer

The PersistentVolume specifies `accessModes: ReadWriteOnce`, which means the volume can be mounted as read-write by only a single node at a time. This is a Kubernetes access mode that restricts the volume to a single consumer (node) for read-write operations, preventing concurrent access from multiple nodes.

Exam trap

The trap here is that candidates often confuse `ReadWriteOnce` with `ReadWriteMany` or assume that `Retain` means automatic deletion, when in fact `Retain` preserves the PV and its data after PVC release.

How to eliminate wrong answers

Option B is wrong because `ReadWriteOnce` explicitly limits the volume to a single node; multiple nodes simultaneously would require `ReadWriteMany` or `ReadOnlyMany`. Option C is wrong because the `persistentVolumeReclaimPolicy: Retain` means the PV is not automatically deleted when its PVC is released; instead, the PV remains with its data intact for manual reclamation. Option D is wrong because this PV uses a `hostPath` volume, which is a static provisioning method; dynamic provisioning requires a StorageClass with a provisioner, which is not defined here.

31
MCQmedium

A StorageClass named 'fast-ssd' uses the provisioner 'kubernetes.io/gce-pd' and has volumeBindingMode: WaitForFirstConsumer. A PVC 'my-pvc' requests 100Gi storage from this StorageClass. A pod using the PVC is scheduled to a node in zone 'us-central1-a'. When is the PV provisioned?

A.When the pod is scheduled to a node
B.Immediately when the PVC is created
C.When the pod starts running
D.The PV is never provisioned automatically; it must be pre-created
AnswerA

With volumeBindingMode: WaitForFirstConsumer, a PVC remains unbound and unprovisioned until the Kubernetes scheduler selects a node for a pod that references the PVC. At that scheduling moment, the scheduler evaluates the pod's storage topology requirements (such as zone or region) as a hard constraint, and only then does the storage backend dynamically provision the PV and bind it to the PVC. This is why the correct answer is 'when the pod is scheduled to a node,' not any earlier or later point in the pod lifecycle.

Why this answer

The StorageClass 'fast-ssd' has volumeBindingMode set to WaitForFirstConsumer. This mode delays volume binding and provisioning until a pod using the PVC is scheduled to a node. When the pod is scheduled to a node in zone 'us-central1-a', the scheduler triggers the provisioning of a PV in that specific zone, ensuring the volume is created in the same zone as the pod.

Exam trap

The trap here is that candidates often confuse 'when the pod starts running' with 'when the pod is scheduled', but the PV provisioning is triggered by the scheduling decision, not by the container runtime starting the pod.

How to eliminate wrong answers

Option B is wrong because with WaitForFirstConsumer, provisioning does not happen immediately when the PVC is created; it is deferred until a pod consumes the PVC. Option C is wrong because provisioning occurs when the pod is scheduled to a node, not when the pod starts running; the PV is bound and provisioned during the scheduling phase, before the pod actually starts. Option D is wrong because the PV is provisioned automatically by the dynamic provisioner (kubernetes.io/gce-pd) when the WaitForFirstConsumer condition is met; it does not need to be pre-created.

32
MCQmedium

A pod needs to share data between two containers during their lifecycle, but the data does not need to persist after the pod is deleted. Which volume type is most appropriate?

A.emptyDir
B.PersistentVolumeClaim
C.hostPath
D.configMap
AnswerA

An emptyDir volume is provisioned when a Pod is assigned to a node, initially empty. It provides a temporary, shared directory accessible by all containers within that specific Pod, making it ideal for inter-container communication or temporary data storage. Crucially, its contents are deleted permanently when the Pod terminates, crashes, or is removed from the node, ensuring data isolation and cleanup. This ephemeral nature perfectly suits the requirement for data sharing that only needs to persist for the duration of the pod's existence.

Why this answer

The emptyDir volume type is the correct choice because it creates an empty directory when a pod is assigned to a node, and it exists as long as the pod runs. Containers within the same pod can read and write to this shared volume, making it ideal for temporary data exchange (e.g., sidecar log shipping or file-based IPC). When the pod is deleted, the emptyDir and its contents are permanently removed, matching the requirement that data does not need to persist.

Exam trap

The trap here is that candidates often confuse emptyDir with hostPath, thinking both are ephemeral, but hostPath data persists on the node even after the pod is deleted, which violates the 'no persistence after pod deletion' requirement.

How to eliminate wrong answers

Option B (PersistentVolumeClaim) is wrong because it requests persistent storage that outlives the pod's lifecycle, which contradicts the requirement that data does not persist after pod deletion. Option C (hostPath) is wrong because it mounts a file or directory from the host node's filesystem into the pod, making data persist on the node even after the pod is deleted, and it also introduces node-specific coupling and potential security risks. Option D (configMap) is wrong because it is designed to inject configuration data (e.g., key-value pairs, files) into containers, not to serve as a writable shared volume for runtime data exchange between containers.

33
MCQmedium

Which of the following is a required field when defining a PersistentVolume?

A.storageClassName
B.nodeAffinity
C.capacity
D.persistentVolumeReclaimPolicy
AnswerC

The capacity field is a mandatory attribute in a PersistentVolume definition, specifically requiring the storage key to declare the volume's size (e.g., 10Gi). Kubernetes relies on this value during the binding process to match the PV against the storage requests of a PersistentVolumeClaim. Without specifying capacity, the API server will reject the PV manifest during validation.

Why this answer

In Kubernetes, a PersistentVolume (PV) must define its storage capacity using the `capacity` field, which specifies the amount of storage the PV provides (e.g., `storage: 10Gi`). This is a required field because the PV represents a piece of storage in the cluster, and the scheduler and PersistentVolumeClaim (PVC) binding logic need to know the available size to match claims. Without `capacity`, the PV definition is invalid and will be rejected by the API server.

Exam trap

The trap here is that candidates often confuse optional fields like `storageClassName` or `persistentVolumeReclaimPolicy` as required, because they are commonly used in examples, but the CKA exam tests the strict API schema requirement that only `capacity` is mandatory for a PersistentVolume definition.

How to eliminate wrong answers

Option A is wrong because `storageClassName` is optional; if omitted, the PV uses the default StorageClass or no class, and it is not a required field for PV creation. Option B is wrong because `nodeAffinity` is only required for PVs backed by local storage (e.g., `hostPath` or `local` volumes) to restrict the PV to specific nodes, but it is not a general requirement for all PV types. Option D is wrong because `persistentVolumeReclaimPolicy` is optional and defaults to `Retain`; it controls what happens to the PV after the PVC is released, but it is not mandatory for defining the PV.

34
MCQhard

You have a PVC that is bound to a PV with a filesystem volume mode. You want to use the volume as a block device in a pod. What should you do?

A.Use a hostPath volume instead.
B.Set volumeDevices in the pod spec instead of volumeMounts.
C.Create a new PVC with volumeMode: Block and bind it to a new PV.
D.Modify the PV's volumeMode to Block.
AnswerC

To transition to a raw block device, you must define a new PersistentVolumeClaim with volumeMode explicitly set to Block. This PVC must then bind to a newly provisioned PersistentVolume that also supports and specifies volumeMode: Block, ensuring the storage plugin exposes the raw block device directly to the container.

Why this answer

A PVC with `volumeMode: Block` must be created and bound to a PV that also has `volumeMode: Block` to use the volume as a block device in a pod. The existing PVC is bound to a PV with `volumeMode: Filesystem`, which cannot be used as a block device without recreating the underlying storage. You cannot change the volume mode of an existing PV or PVC; you must provision new resources with the correct mode.

Exam trap

The trap here is that candidates assume they can simply change the pod spec (e.g., use `volumeDevices`) or modify the PV to convert a filesystem volume into a block device, but Kubernetes requires the volume mode to be set at PV creation and matched in the PVC, making it immutable after binding.

How to eliminate wrong answers

Option A is wrong because using a `hostPath` volume bypasses the PVC/PV abstraction and does not solve the requirement of using the existing PVC as a block device; it introduces a different storage type with its own limitations. Option B is wrong because `volumeDevices` in the pod spec is used to consume a block volume, but the underlying PVC/PV must already have `volumeMode: Block`; simply changing the pod spec does not convert a filesystem-mode volume into a block device. Option D is wrong because the `volumeMode` field of a PV is immutable after creation; you cannot modify it to `Block` without deleting and recreating the PV and its associated storage.

35
Multi-Selectmedium

Which TWO of the following are valid access modes for a PersistentVolume in Kubernetes? (Select two.)

Select 2 answers
A.WriteMany
B.ReadOnlySingle
C.ReadWriteOnce
D.ReadWriteMany
E.ReadWriteOncePerNode
AnswersC, D

ReadWriteOnce (RWO) is a valid access mode that allows a volume to be mounted with read-write access on a single node. Multiple Pods running on that same node can concurrently use the volume, but while it is attached to that node, no other node can mount it. This mode is typical for block storage like AWS EBS or Google Persistent Disks, which are designed for single-node attachment and do not support multi-node reads or writes.

Why this answer

ReadWriteOnce (C) is a valid PersistentVolume access mode, meaning the volume can be mounted as read-write by a single node at a time. ReadWriteMany (D) is also valid, allowing the volume to be mounted as read-write by many nodes simultaneously. These are two of the four standard Kubernetes access modes, alongside ReadOnlyMany and ReadWriteOncePod.

WriteMany (A) is not a valid mode because the read/write distinction is missing. ReadOnlySingle (B) is invalid since the correct read-only mode is ReadOnlyMany. ReadWriteOncePerNode (E) is not a real access mode; the per-node semantics are already covered by ReadWriteOnce.

Exam trap

The trap here is that candidates confuse the valid access modes with similar-sounding but non-existent modes like 'WriteMany' or 'ReadWriteOncePerNode', which are not part of the Kubernetes API specification.

36
MCQmedium

Which of the following volume types provides ephemeral storage that shares the pod's lifecycle and is initially empty?

A.secret
B.emptyDir
C.configMap
D.hostPath
AnswerB

An `emptyDir` volume is created when the pod is scheduled and deleted permanently when the pod is removed, satisfying the shared-lifecycle constraint. Its contents start empty and persist across container restarts within that pod, unlike `hostPath`, which survives pod deletion by binding to the node's filesystem.

Why this answer

B is correct because an `emptyDir` volume is created empty when a Pod is assigned to a node and exists as long as that Pod is running. It provides ephemeral storage that shares the Pod's lifecycle, meaning it is deleted when the Pod is removed, and it is initially empty, making it ideal for scratch space, caching, or temporary data.

Exam trap

The trap here is that candidates often confuse `emptyDir` with `hostPath` or `configMap`, mistakenly thinking that any volume that is initially empty must be a `configMap` or that `hostPath` provides ephemeral storage, when in fact `emptyDir` is the only volume type that is both ephemeral and initially empty by design.

How to eliminate wrong answers

Option A is wrong because a `secret` volume is used to inject sensitive data (e.g., passwords, tokens) into a Pod, not for ephemeral storage; it is populated from the Kubernetes API and is not initially empty. Option C is wrong because a `configMap` volume provides configuration data from ConfigMap objects, not ephemeral storage; it is also pre-populated with key-value pairs and shares the Pod's lifecycle but is not initially empty. Option D is wrong because a `hostPath` volume mounts a file or directory from the host node's filesystem into the Pod, persisting beyond the Pod's lifecycle and not being initially empty; it is not ephemeral and does not share the Pod's lifecycle.

37
MCQmedium

A team is designing a storage solution for a Cassandra cluster on Kubernetes. Each pod must have its own dedicated storage, and the cluster must be able to scale up and down dynamically. Which Kubernetes resource should be used to manage the storage?

A.ReplicaSet with emptyDir volumes
B.DaemonSet with hostPath volumes
C.StatefulSet with a volumeClaimTemplate
D.Deployment with a single PersistentVolume shared by all pods
AnswerC

StatefulSets are specifically designed for stateful applications like Cassandra that require stable network identifiers and persistent, dedicated storage. By utilizing a volumeClaimTemplate, Kubernetes automatically provisions a unique PersistentVolumeClaim (PVC) for each Pod replica, ensuring that even if a Pod is rescheduled, it reconnects to its exact corresponding volume.

Why this answer

StatefulSet is the correct choice because it provides stable, unique network identities and dedicated storage for each pod via a volumeClaimTemplate. This ensures each Cassandra pod gets its own PersistentVolume, which is essential for stateful applications that require data persistence and ordered scaling. The volumeClaimTemplate automatically provisions a unique PersistentVolumeClaim for each replica, enabling dynamic scaling up and down while preserving data integrity.

Exam trap

The trap here is that candidates often choose Deployment with a shared PersistentVolume, mistakenly thinking it simplifies management, but they overlook the need for dedicated, persistent storage per pod and the ordered scaling guarantees that only StatefulSet provides.

How to eliminate wrong answers

Option A is wrong because emptyDir volumes are ephemeral and tied to the pod's lifecycle; data is lost when the pod is deleted, making it unsuitable for a Cassandra cluster that requires persistent storage. Option B is wrong because hostPath volumes bind to a specific node's filesystem, which prevents dynamic scaling and can cause data inconsistency if pods are rescheduled to different nodes; DaemonSets also run one pod per node, not suitable for a scalable Cassandra cluster. Option D is wrong because a single PersistentVolume shared by all pods would create a single point of failure and contention, violating the requirement for each pod to have its own dedicated storage; Deployments also do not guarantee stable pod identities or ordered scaling needed for stateful applications.

38
MCQeasy

You are a cluster administrator managing a production Kubernetes cluster that hosts a stateful application using StatefulSets with PersistentVolumeClaims (PVCs) backed by a cloud provider's persistent disk. A developer reports that a new pod in the StatefulSet is stuck in 'Pending' state. You describe the StatefulSet and see that it has 3 replicas. Two pods are Running, but the third pod (pod-2) is Pending. You check the PVC for pod-2 and see it is 'Pending'. The StorageClass uses 'WaitForFirstConsumer' volume binding mode. The node where pod-2 should run has sufficient resources. Other PVCs in the same namespace bound successfully. What is the most likely cause of the pending PVC and pod?

A.The PV that should bind to the PVC has a nodeAffinity that does not match any available node.
B.The CSI driver is not installed on the node where pod-2 is scheduled.
C.The PVC's requested storage size exceeds the available capacity in the cloud provider's quota.
D.The PVC's access mode is ReadWriteOnce, but the pod requires ReadWriteMany.
AnswerA

When a PersistentVolumeClaim (PVC) uses the WaitForFirstConsumer binding mode, the selection or provisioning of a PersistentVolume (PV) is delayed until a pod requiring that PVC is scheduled. If the selected PV has nodeAffinity rules that do not match the node where pod-2 was scheduled, the volume attachment will fail. This mismatch prevents the volume from being mounted, causing pod-2 to remain in a Pending state, unable to start its containers.

Why this answer

With 'WaitForFirstConsumer' volume binding mode, the PVC binding is deferred until a pod using it is scheduled. The PV that should bind to the PVC has a nodeAffinity that does not match any available node, preventing the scheduler from binding the PVC and scheduling the pod. This results in both the PVC and pod remaining in 'Pending' state, even though the node has sufficient resources.

Exam trap

The trap here is that candidates often assume a Pending PVC is always due to insufficient storage capacity or quota, ignoring the impact of volume binding modes and nodeAffinity constraints on scheduling.

How to eliminate wrong answers

Option B is wrong because the CSI driver must be installed on all nodes that can run pods using the CSI driver; if it were missing on the scheduled node, the pod would fail with a different error (e.g., 'FailedMount'), not remain Pending due to an unbounded PVC. Option C is wrong because if the requested storage size exceeded the cloud provider's quota, the PVC would likely fail with a specific error (e.g., 'ProvisioningFailed') rather than remain Pending, and other PVCs in the same namespace bound successfully, indicating quota is not the issue. Option D is wrong because ReadWriteOnce is the default access mode for most cloud persistent disks and is compatible with StatefulSet pods; ReadWriteMany would be required only if multiple pods need to write simultaneously to the same volume, which is not the case here.

39
MCQeasy

Which reclaim policy will cause the underlying storage to be deleted when the associated PersistentVolume is released from a PersistentVolumeClaim?

A.Delete
B.Recycle
C.Retain
D.Archive
AnswerA

The "Delete" reclaim policy is the correct choice because it ensures that when a PersistentVolumeClaim (PVC) is deleted, Kubernetes automatically de-provisions both the PersistentVolume (PV) object and the actual underlying storage resource. This automation removes the storage asset, such as an AWS EBS volume or a GCP Persistent Disk, from the external infrastructure, preventing orphaned resources and incurring unnecessary costs.

Why this answer

The Delete reclaim policy instructs the system to remove the underlying storage asset (e.g., an AWS EBS volume, GCE Persistent Disk, or NFS export) when the PersistentVolume is released from a PersistentVolumeClaim. This is the only policy that automatically cleans up the physical storage, ensuring no orphaned resources remain.

Exam trap

The trap here is that candidates may confuse 'Recycle' with 'Delete' because both involve automatic cleanup, but Recycle only scrubs data without removing the storage asset, and it is no longer supported in modern Kubernetes versions.

How to eliminate wrong answers

Option B (Recycle) is wrong because Recycle was a legacy policy that performed a basic scrub (e.g., 'rm -rf /thevolume') and made the volume available again, but it did not delete the underlying storage; it was deprecated in Kubernetes 1.15 and removed in 1.20. Option C (Retain) is wrong because Retain leaves the PersistentVolume and its underlying storage intact after the PVC is released, requiring manual administrator intervention to reclaim or delete the storage. Option D (Archive) is wrong because Archive is not a valid Kubernetes PersistentVolume reclaim policy; the only three defined policies are Retain, Recycle (deprecated), and Delete.

40
MCQeasy

Which of the following commands will list all PersistentVolumeClaims in a cluster?

A.kubectl get pv
B.kubectl get pvc
C.kubectl get claims
D.kubectl get persistent-volume-claims
AnswerB

Correct. `kubectl get pvc` is the standard shorthand command to list all PersistentVolumeClaims.

Why this answer

`kubectl get pvc` is the correct command to list PersistentVolumeClaims using the official short name. Option A lists PersistentVolumes (`pv`). Option C (`claims`) and Option D (`persistent-volume-claims` with hyphens) are invalid resource names and will result in an error.

Exam trap

Candidates often confuse the shorthand `pv` for PersistentVolume with `pvc` for PersistentVolumeClaim, or mistakenly believe that `kubectl get claims` is valid.

How to eliminate wrong answers

Option A is wrong because `kubectl get pv` lists PersistentVolumes, not PersistentVolumeClaims; these are distinct resources where PVs represent actual storage volumes and PVCs represent requests for storage. Option C is wrong because `kubectl get claims` is not a valid kubectl command; Kubernetes does not recognize 'claims' as a resource abbreviation, and this will result in an error.

41
Multi-Selecthard

Which THREE of the following are true about expanding a PersistentVolumeClaim?

Select 3 answers
A.After expanding the PVC, the pod must be recreated for the new size to take effect.
B.You can reduce the size of a PVC after creation.
C.The StorageClass must have allowVolumeExpansion: true.
D.The volume plugin must support expansion.
E.You can expand a PVC by editing its spec.resources.requests.storage field.
AnswersC, D, E

The StorageClass referenced by a PersistentVolumeClaim must have the allowVolumeExpansion field set to true for PVC expansion to be permitted. This field tells the PersistentVolumeController that claims using this class are eligible for resizing, and it enables the controller to process updates to the requested storage size. If the field is false or omitted, the API server—or the external controller—will not allow the PVC's storage request to be increased, and any such edit will either be rejected or have no effect on the actual volume.

Why this answer

Option C is correct because a PersistentVolumeClaim can only be expanded if its StorageClass explicitly sets allowVolumeExpansion: true; without this field, the API server rejects the resize request. Option D is correct because even with allowVolumeExpansion enabled, the underlying CSI or in-tree volume plugin must actually support online or offline expansion for the operation to succeed. Option E is correct because the standard way to request more capacity is to edit the PVC's spec.resources.requests.storage field to a larger value, which triggers the resize workflow.

Option A is not universally true: many CSI drivers support online expansion so the pod does not need to be recreated, and only certain filesystem-resize cases require a pod restart. Option B is incorrect because Kubernetes does not support shrinking a PVC; the requested storage can only be increased, never decreased.

Exam trap

The trap here is that candidates often think a pod must be recreated for the new size to take effect, but Kubernetes handles filesystem resizing automatically for supported plugins, making option A a common distractor.

42
MCQeasy

Which access mode allows multiple pods running on different nodes to read from and write to a PersistentVolume at the same time?

A.ReadOnlyMany
B.ReadWriteMany
C.ReadWriteOnce
D.ReadWriteOncePod
AnswerB

ReadWriteMany (RWX) is the correct access mode because it allows a persistent volume to be mounted concurrently by multiple nodes with both read and write capabilities. This enables multiple pods distributed across different nodes in the cluster to share, read, and write to the same underlying storage system simultaneously.

Why this answer

ReadWriteMany (RWM) is the access mode that allows multiple pods running on different nodes to simultaneously read from and write to a PersistentVolume. This is defined in the Kubernetes PersistentVolume specification and is supported by storage backends like NFS, GlusterFS, or CephFS, which provide shared filesystem semantics across network-attached storage.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (which allows multiple pods on the same node) with ReadWriteMany, forgetting that ReadWriteOnce restricts access to a single node, not just a single pod, and thus cannot support pods on different nodes.

How to eliminate wrong answers

Option A is wrong because ReadOnlyMany allows multiple pods to read from the PV simultaneously but prohibits any write operations, so it cannot support concurrent writes. Option C is wrong because ReadWriteOnce allows only a single node to mount the PV with read-write access, meaning pods on different nodes cannot write concurrently. Option D is wrong because ReadWriteOncePod restricts the PV to a single pod (even on the same node), preventing any multi-pod or multi-node concurrent access.

43
MCQmedium

A cluster administrator wants to expand an existing PersistentVolumeClaim (PVC) that is bound to a PersistentVolume (PV) with reclaim policy Delete and storage class 'fast'. The PV was dynamically provisioned. Which condition is required for the PVC expansion to succeed?

A.The PV must be in Released state.
B.The StorageClass 'fast' must have allowVolumeExpansion: true.
C.The reclaim policy must be changed to Retain before expansion.
D.The PVC must be using access mode ReadWriteOnce.
AnswerB

This statement is correct because volume expansion is a feature that must be explicitly enabled at the StorageClass level. The `allowVolumeExpansion: true` parameter within the StorageClass definition signals to Kubernetes and the underlying storage provisioner that volumes provisioned by this class are capable of being resized. Without this setting, any attempt to expand a PersistentVolumeClaim (PVC) will be rejected by the API server, regardless of the underlying storage system's capabilities.

Why this answer

For PVC expansion to succeed with a dynamically provisioned PV, the StorageClass must have the `allowVolumeExpansion: true` field set. This field explicitly enables volume expansion for all PVCs using that StorageClass. Without it, the PVC expansion request will be rejected even if other conditions are met.

Exam trap

The trap here is that candidates often confuse PV reclaim policy (Delete/Retain) with expansion capabilities, or assume the PV must be in a specific state like Released, when in fact the StorageClass setting is the sole gatekeeper for volume expansion.

How to eliminate wrong answers

Option A is wrong because the PV must be in Bound state (not Released) to allow PVC expansion; a Released PV indicates the PVC was deleted, and expansion is not possible. Option C is wrong because the reclaim policy (Delete/Retain) does not affect the ability to expand a PVC; expansion is controlled by the StorageClass setting, not the reclaim policy. Option D is wrong because PVC expansion is supported for all access modes (ReadWriteOnce, ReadOnlyMany, ReadWriteMany) as long as the underlying volume plugin supports it; ReadWriteOnce is not a requirement.

44
MCQmedium

A pod uses a PVC with access mode RWO. The pod is scheduled on node A. You want to schedule another pod on node B that uses the same PVC. What will happen?

A.The second pod will be stuck in ContainerCreating state until the first pod releases the volume
B.Both pods will mount the volume and share it without issues
C.The second pod will successfully mount the volume as read-only
D.The first pod will be evicted to allow the second pod to use the volume
AnswerA

When a PersistentVolume is bound using ReadWriteOnce (RWO), it can only be mounted by a single node at any given time. If a second pod is scheduled to a different node and attempts to use the same PVC, the volume attachment controller will block the attachment to prevent data corruption. Consequently, the second pod remains stuck in the ContainerCreating state, generating Multi-Attach error events until the first pod is deleted and the volume is fully detached from its node.

Why this answer

A PVC with access mode RWO (ReadWriteOnce) can only be mounted as a block device or filesystem by a single node at a time. When the first pod on node A has the volume attached, the second pod on node B cannot attach the same volume because the underlying storage (e.g., an AWS EBS volume or GCE Persistent Disk) does not support multi-node attachment. The second pod will remain in ContainerCreating state with a 'Multi-Attach error' until the first pod releases the volume (e.g., by being deleted or rescheduled).

Exam trap

The trap here is that candidates confuse access modes with pod-level permissions, assuming 'ReadWriteOnce' means the volume can be mounted by multiple pods as long as they are on the same node, or that the second pod will mount as read-only, when in fact the restriction is node-based and enforced at the storage layer.

How to eliminate wrong answers

Option B is wrong because RWO explicitly restricts the volume to a single node; both pods cannot mount and share the volume simultaneously. Option C is wrong because RWO does not imply read-only access; the second pod would still fail to attach the volume at all, regardless of the mount mode. Option D is wrong because Kubernetes does not evict the first pod to free the volume for the second pod; the scheduler will simply not schedule the second pod on a different node if the volume is already attached, or the pod will hang in ContainerCreating.

45
Multi-Selectmedium

Which THREE statements about PersistentVolumeClaims (PVCs) are correct?

Select 3 answers
A.A PVC defines the reclaim policy for the underlying PersistentVolume.
B.A PVC binds to a PersistentVolume that satisfies its storage request and access modes.
C.A PVC can request storage expansion if the StorageClass allows it.
D.A PVC is a cluster-scoped resource.
E.A PVC can be mounted by multiple Pods if it is bound to a PV with ReadWriteMany access mode.
AnswersB, C, E

Kubernetes matches a PVC to a PV by comparing requested capacity and access modes; the selected PV must have at least the requested storage size and advertise access modes that satisfy the claim. The control plane performs this binding automatically, and when a match is found, the claim and volume are bound in a one-to-one relationship, meaning no other PVC can use that same PV until the bound is released. If no suitable PV exists, the claim stays in Pending, awaiting either an administrator-created PV or a dynamically provisioned volume from the named StorageClass.

Why this answer

Option B is correct because the PersistentVolume controller matches a PVC to a PV whose capacity meets or exceeds the PVC's spec.resources.requests.storage and whose access modes (e.g., ReadWriteOnce, ReadWriteMany) satisfy the PVC's spec.accessModes, then binds them. Option C is correct because a PVC can request a larger size by editing spec.resources.requests.storage, and the resize succeeds only if the bound StorageClass has allowVolumeExpansion: true and the underlying CSI driver supports expansion. Option E is correct because access modes are enforced by the PV/PVC binding: a PVC requesting ReadWriteMany that binds to a PV supporting ReadWriteMany can be mounted read-write by multiple Pods simultaneously (e.g., NFS or CephFS).

Option A is wrong because the reclaim policy (Retain, Delete, Recycle) is defined on the PersistentVolume or inherited from the StorageClass, not on the PVC. Option D is wrong because a PVC is a namespaced resource, unlike the cluster-scoped PersistentVolume.

Exam trap

The trap here is that candidates often confuse PVCs as cluster-scoped resources (like PVs) or assume PVCs control PV reclaim policies, when in fact PVCs are namespaced and only request storage characteristics.

46
MCQmedium

A DevOps team needs to provide persistent storage to a set of pods that all require read-write access to the same data simultaneously. Which volume type should they use?

A.PersistentVolumeClaim with ReadWriteMany
B.hostPath
C.emptyDir
D.PersistentVolumeClaim with ReadWriteOnce
AnswerA

A PersistentVolumeClaim configured with the ReadWriteMany (RWX) access mode allows a volume to be mounted as read-write by many nodes concurrently. This is the correct choice for enabling multiple pods distributed across different nodes in a cluster to simultaneously access and modify the same persistent storage backend.

Why this answer

A PersistentVolumeClaim with ReadWriteMany (RWX) is the correct choice because it allows multiple pods to mount the same volume simultaneously with read-write access. This access mode is supported by network-based storage backends like NFS, GlusterFS, or CephFS, which provide the necessary concurrency controls for shared access across pods.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (RWO) with multi-pod access, forgetting that RWO explicitly limits the volume to a single pod mount, while ReadWriteMany (RWX) is required for simultaneous shared access.

How to eliminate wrong answers

Option B (hostPath) is wrong because it mounts a directory from the host node's filesystem into the pod, which does not support simultaneous read-write access from pods running on different nodes; it is also not portable and poses security risks. Option C (emptyDir) is wrong because its lifecycle is tied to the pod — data is deleted when the pod is removed, and it cannot be shared across pods on different nodes. Option D (PersistentVolumeClaim with ReadWriteOnce) is wrong because ReadWriteOnce (RWO) restricts the volume to be mounted as read-write by a single pod on a single node, making it unsuitable for multi-pod shared access.

47
MCQhard

A cluster has a CSI driver installed. A pod using a CSI volume is in CrashLoopBackOff. 'kubectl describe pod' shows: 'failed to mount volume: rpc error: code = DeadlineExceeded desc = context deadline exceeded'. What is the MOST likely cause?

A.The CSI driver is failing to respond in time.
B.The PVC is not bound.
C.The CSI driver is not installed.
D.The volume mode is Block but the pod expects Filesystem.
AnswerA

When the kubelet or volume manager attempts to attach or mount a CSI volume, it communicates with the CSI driver via gRPC. If the driver fails to respond within the designated timeout period, the operation fails with a timeout error in the pod events, indicating the driver is unresponsive or overloaded.

Why this answer

The error 'context deadline exceeded' indicates that the CSI driver's gRPC call to mount the volume did not complete within the default timeout (typically 30 seconds). This is most commonly caused by the CSI driver being unresponsive due to resource starvation, network issues, or a bug in the driver itself. Since the CSI driver is installed and the pod is attempting to mount, the failure is in the driver's response time, not in the PVC binding or volume mode.

Exam trap

The trap here is that candidates may think 'context deadline exceeded' is a generic network timeout or PVC issue, but in the CSI context it specifically points to the driver's gRPC response timeout, not a binding or installation problem.

How to eliminate wrong answers

Option B is wrong because if the PVC were not bound, the pod would remain in 'ContainerCreating' with an error like 'persistentvolumeclaim not found' or 'waiting for a volume to be created', not a 'context deadline exceeded' from the CSI driver. Option C is wrong because if the CSI driver were not installed, the pod would fail with 'no volume plugin matched' or 'failed to get CSI driver' errors, not a timeout from an existing driver. Option D is wrong because a volume mode mismatch (Block vs Filesystem) would produce an error like 'wrong volume mode' or 'block volume not supported', not a gRPC deadline exceeded.

48
MCQeasy

A pod is unable to start because the PersistentVolumeClaim it references is still in 'Pending' state. What is the most likely cause?

A.The PersistentVolumeClaim's storage class does not exist or cannot provision a volume
B.The pod's YAML has a syntax error
C.The pod is using a hostPath volume
D.The node has insufficient CPU resources
AnswerA

When a PersistentVolumeClaim references a non-existent or misconfigured StorageClass, the dynamic volume provisioner cannot fulfill the request. Consequently, the PVC remains stuck in a Pending state indefinitely. Because the Pod's volume mount depends on a successfully bound PVC, the Kubernetes scheduler cannot assign the Pod to a node, preventing it from starting.

Why this answer

A PersistentVolumeClaim (PVC) remains in 'Pending' state when it cannot find a suitable PersistentVolume (PV) to bind to or when its storage class cannot dynamically provision one. The most common cause is that the referenced storage class does not exist, is misspelled, or lacks a provisioner that can create the volume, leaving the PVC unbound and the pod unable to start.

Exam trap

The trap here is that candidates often confuse 'Pending' state for a PVC with pod scheduling issues, thinking it is a resource constraint on the node, rather than recognizing it as a storage binding or provisioning failure.

How to eliminate wrong answers

Option B is wrong because a YAML syntax error would typically prevent the pod from being created at all, not cause the PVC to remain in 'Pending' state; the pod would fail with a validation error. Option C is wrong because using a hostPath volume does not involve a PVC, so it would not cause a PVC to be stuck in 'Pending'; the pod would start directly if the host path exists. Option D is wrong because insufficient CPU resources on a node would result in the pod being in 'Pending' state due to resource scheduling issues, not because of a PVC being in 'Pending'; the pod would show a different reason such as 'Unschedulable'.

49
MCQeasy

Which access mode allows multiple pods to read and write to a PersistentVolume simultaneously when all pods are on the same node?

A.ReadWriteOnce
B.ReadOnlyMany
C.ReadWriteMany
D.ReadWriteOncePod
AnswerA

The ReadWriteOnce (RWO) access mode permits a PersistentVolume to be mounted as read-write by a single node at any given time. Crucially, once mounted by that node, any number of pods scheduled onto that specific node can concurrently access the volume for both reading and writing operations. This perfectly satisfies the question's requirement for multiple pods to read and write, provided they are co-located on the same host.

Why this answer

ReadWriteOnce (RWO) allows a PersistentVolume to be mounted as read-write by a single node, but multiple pods on that same node can all access the volume simultaneously. This is because the access mode restriction is per node, not per pod, so all pods scheduled on the same node share the same mount and can read and write concurrently.

Exam trap

The trap here is that candidates often confuse 'node-level' access with 'pod-level' access, mistakenly thinking ReadWriteOnce means only one pod can use the volume, when in fact it allows multiple pods on the same node to read and write concurrently.

How to eliminate wrong answers

Option B (ReadOnlyMany) is wrong because it only permits read-only access, not read-write, and the question explicitly requires both reading and writing. Option C (ReadWriteMany) is wrong because it allows read-write access from multiple nodes, not just multiple pods on the same node, and it requires a distributed filesystem (e.g., NFS, GlusterFS) that supports concurrent node access, which is broader than the scenario described. Option D (ReadWriteOncePod) is wrong because it restricts the volume to a single pod on a single node, preventing multiple pods from accessing it simultaneously even on the same node.

50
MCQeasy

Which volume type in Kubernetes allows a Pod to share data between its containers, with the data being deleted when the Pod is removed?

A.hostPath
B.emptyDir
C.configMap
D.secret
AnswerB

emptyDir is created when the Pod is assigned to a node and exists as long as that Pod is running. It is used for sharing data between containers and is deleted when the Pod is removed.

Why this answer

The emptyDir volume type is created when a Pod is assigned to a node and exists as long as the Pod is running. It provides a shared writable directory for all containers within the same Pod, and its contents are deleted when the Pod is removed from the node. This makes it the correct choice for ephemeral data sharing between containers.

Exam trap

The trap here is that candidates often confuse emptyDir with hostPath, thinking hostPath also provides ephemeral storage, but hostPath data persists on the node even after the Pod is deleted, which violates the requirement of data deletion upon Pod removal.

How to eliminate wrong answers

Option A is wrong because hostPath mounts a file or directory from the host node's filesystem into the Pod, and the data persists on the node even after the Pod is deleted, which does not match the requirement of data being deleted with the Pod. Option C is wrong because configMap is used to inject configuration data into Pods as files or environment variables, and it is not designed for sharing writable data between containers; its data is read-only by default and persists independently of the Pod lifecycle. Option D is wrong because secret is used to store sensitive information like passwords or tokens, and while it can be mounted into containers, it is read-only and not intended for ephemeral data sharing between containers.

51
MCQmedium

A pod is using a PersistentVolumeClaim (PVC) named 'mypvc' which is bound to a PersistentVolume (PV) with reclaim policy 'Retain'. The pod is deleted and then the PVC is deleted. What happens to the PV?

A.The PV remains but is in 'Released' state.
B.The PV is automatically deleted.
C.The PV is immediately bound to another PVC.
D.The PV is recycled for reuse.
AnswerA

When a PVC bound to a PV with a Retain reclaim policy is deleted, the PV is preserved to prevent data loss. Its status transitions to Released, indicating that the claim has been deleted but the volume still contains data and requires manual intervention by an administrator to be reclaimed or reused.

Why this answer

When a PVC is deleted, the associated PV with a 'Retain' reclaim policy is not automatically deleted or recycled. Instead, the PV transitions to a 'Released' state, indicating that its data is preserved but it is no longer bound to a PVC. The PV remains in the cluster until an administrator manually reclaims it by removing the claimRef or deleting the PV.

Exam trap

The trap here is that candidates often confuse the 'Retain' policy with automatic recycling or deletion, assuming the PV will be cleaned up or rebound, when in fact it remains in a 'Released' state requiring manual administrator action.

How to eliminate wrong answers

Option B is wrong because the 'Retain' reclaim policy explicitly prevents automatic deletion of the PV; only a 'Delete' policy would cause automatic deletion. Option C is wrong because a PV in 'Released' state is not automatically bound to another PVC; it must be manually reclaimed by an administrator. Option D is wrong because the 'Retain' policy does not recycle or wipe the PV for reuse; recycling is associated with the 'Recycle' policy, which is deprecated in Kubernetes.

52
MCQhard

A cluster has a PersistentVolumeClaim (PVC) named 'data-claim' bound to a PersistentVolume (PV) with reclaim policy 'Retain'. The PVC is deleted. The PV now shows status 'Released'. What must be done so that the PV can be reused by a new PVC?

A.Nothing; the PV will automatically become Available after some time.
B.Delete and recreate the PersistentVolume.
C.Create a new PVC with the same name.
D.Change the reclaim policy to Delete.
AnswerB

Deleting and recreating the PersistentVolume resource is a standard and clean way to make the underlying storage available for new claims. Because the reclaim policy is Retain, deleting the Kubernetes PV object does not destroy the actual data on the external storage provider. Recreating the PV with the same storage details allows a new PVC to bind to it successfully.

Why this answer

When a PVC is deleted and the PV has a reclaim policy of 'Retain', the PV enters a 'Released' state, meaning it still contains the data but is no longer bound to the original PVC. The PV cannot be directly reused by a new PVC because its claim reference is still set to the deleted PVC's UID. To make the PV available again, you must manually delete and recreate the PV (or at least delete it and re-create it with a clean claimRef), which resets its status to 'Available'.

Exam trap

The CKA exam often tests the misconception that a 'Released' PV will automatically become 'Available' over time, but the 'Retain' policy requires explicit administrative action to clear the claim reference.

How to eliminate wrong answers

Option A is wrong because a PV with reclaim policy 'Retain' does not automatically transition from 'Released' to 'Available'; manual intervention is required. Option C is wrong because creating a new PVC with the same name does not clear the existing PV's claimRef; the PV remains 'Released' and will not bind to the new PVC unless the PV is manually cleaned. Option D is wrong because changing the reclaim policy to 'Delete' would cause the PV to be deleted (and its underlying storage potentially removed), not make it 'Available' for reuse; the correct action is to delete and recreate the PV.

53
MCQeasy

Which resource type is used to define a template for dynamically provisioning PersistentVolumes?

A.PersistentVolume
B.VolumeAttachment
C.StorageClass
D.PersistentVolumeClaim
AnswerC

A StorageClass acts as the template and driver definition for dynamic volume provisioning in Kubernetes. It defines which volume plugin (provisioner) to use and passes specific parameters, such as IOPS or replication factors, to the underlying storage provider when a user requests storage via a PersistentVolumeClaim.

Why this answer

StorageClass is the correct resource because it defines a 'class' of storage with a provisioner (e.g., kubernetes.io/aws-ebs) and parameters that Kubernetes uses to dynamically create PersistentVolumes when a PersistentVolumeClaim requests storage. Without a StorageClass, dynamic provisioning cannot occur, as the cluster needs a template to know which storage backend to use and how to configure it.

Exam trap

The trap here is that candidates confuse PersistentVolumeClaim (a request) with the template that defines how to fulfill that request, or think PersistentVolume itself can be used as a template, when in fact it is the result of provisioning, not the definition.

How to eliminate wrong answers

Option A is wrong because a PersistentVolume is a static piece of pre-provisioned storage, not a template for dynamic provisioning; it represents an actual volume that already exists. Option B is wrong because VolumeAttachment is used to attach a volume to a node (via CSI or in-tree drivers) and has no role in defining provisioning templates. Option D is wrong because a PersistentVolumeClaim is a request for storage by a user, not a template for creating volumes; it triggers dynamic provisioning only when a StorageClass is referenced.

54
MCQhard

A CSI driver is installed in the cluster, but a PersistentVolumeClaim using a StorageClass that references this driver remains Pending. The administrator checks the logs of the CSI controller pod and sees no errors. What is a possible cause?

A.The CSI driver is not registered correctly.
B.The StorageClass volumeBindingMode is set to WaitForFirstConsumer.
C.The StorageClass volumeBindingMode is set to Immediate.
D.The PVC requests a size that is not available.
AnswerB

With volumeBindingMode: WaitForFirstConsumer, the PersistentVolumeClaim is intentionally left in the Pending state until a pod that references it is created and scheduled to a node. The external provisioner is not invoked at PVC creation time; instead, the scheduler waits for a pod to consume the volume, then binds and provisions it in the node's zone/topology. Therefore, if no pod has been created, the PVC remaining Pending with no errors is exactly the expected behavior.

Why this answer

If the volumeBindingMode is set to WaitForFirstConsumer, the PV will not be provisioned until a pod using the PVC is scheduled. This is a common pitfall. The CSI driver may be working fine, but the binding mode delays provisioning.

55
MCQeasy

Which access mode allows a PersistentVolume to be mounted as read-write by multiple pods across different nodes?

A.ReadWriteMany (RWX)
B.ReadWriteOnce (RWO)
C.ReadWriteOncePod (RWOP)
D.ReadOnlyMany (ROX)
AnswerA

ReadWriteMany permits a PersistentVolume to be mounted read-write simultaneously by many pods, including pods scheduled across different nodes. ReadWriteOnce restricts access to a single node, and ReadOnlyMany allows only read access, so RWX satisfies the multi-node write requirement.

Why this answer

ReadWriteMany (RWX) is the correct access mode because it allows a PersistentVolume to be mounted as read-write by multiple pods simultaneously, even when those pods are scheduled on different nodes. This is the only access mode that supports concurrent read-write access across nodes, which is essential for shared storage solutions like NFS, GlusterFS, or CephFS.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (RWO) with the ability to mount across nodes, not realizing RWO is per-node, not per-pod, and that ReadWriteMany (RWX) is the only mode that explicitly allows multi-node read-write access.

How to eliminate wrong answers

Option B (ReadWriteOnce, RWO) is wrong because it restricts the volume to be mounted as read-write by only a single pod on a single node; any additional pods attempting to mount the same volume will fail. Option C (ReadWriteOncePod, RWOP) is wrong because it further restricts the volume to be mounted by only one pod cluster-wide, regardless of node, and is a Kubernetes 1.22+ feature for preventing concurrent access entirely. Option D (ReadOnlyMany, ROX) is wrong because it allows multiple pods to mount the volume, but only in read-only mode, not read-write.

56
MCQmedium

A pod uses a PersistentVolumeClaim named 'claim-log'. The PVC is pending. You run 'kubectl describe pvc claim-log' and see the event: 'waiting for a volume to be created, either by external provisioner or manually'. The StorageClass 'standard' has provisioner: 'kubernetes.io/no-provisioner'. What is the most likely cause?

A.The StorageClass 'standard' does not have a dynamic provisioner configured
B.The StorageClass is missing the volumeBindingMode
C.The PVC's access mode is incompatible with the StorageClass
D.The PVC requires a larger storage size than any available PV
AnswerA

When a StorageClass uses 'kubernetes.io/no-provisioner' as its provisioner, Kubernetes cannot automatically create a backing PersistentVolume (PV) when a PersistentVolumeClaim (PVC) is submitted. This requires an administrator to manually pre-create a matching PV with the correct storage capacity, access modes, and storageClassName before the PVC can transition from Pending to Bound.

Why this answer

The StorageClass 'standard' has provisioner: 'kubernetes.io/no-provisioner', which is a static provisioner that does not automatically create volumes. Since the PVC is pending with the event 'waiting for a volume to be created, either by external provisioner or manually', it indicates that no dynamic provisioner is available to automatically provision a PersistentVolume (PV) for the PVC. The most likely cause is that the StorageClass lacks a dynamic provisioner, so a PV must be manually created or an external provisioner must be configured.

Exam trap

A common pitfall in the CKA exam is assuming that a StorageClass with 'kubernetes.io/no-provisioner' can automatically provision volumes. This provisioner indicates static provisioning only; a PersistentVolume must be created manually or by an external provisioner. Candidates often overlook this and expect dynamic provisioning to occur.

How to eliminate wrong answers

Option B is wrong because volumeBindingMode (e.g., Immediate or WaitForFirstConsumer) affects when binding occurs, not whether a volume can be provisioned; the PVC would still wait for a volume even with volumeBindingMode set. Option C is wrong because access mode incompatibility would typically result in a different event, such as 'FailedBinding' or 'no persistent volumes available', not the specific event about waiting for a volume to be created. Option D is wrong because if the PVC required a larger size than any available PV, the event would likely indicate 'no persistent volumes available for this claim' or a similar binding failure, not a waiting state for volume creation.

57
MCQmedium

A cluster administrator needs to create a PersistentVolume that can be mounted as a block device (not a filesystem) by a Pod. Which field in the PersistentVolume spec must be set to enable this?

A.persistentVolumeReclaimPolicy: Retain
B.volumeMode: Filesystem
C.accessModes: ReadWriteOnce
D.volumeMode: Block
AnswerD

Setting `volumeMode: Block` in a PersistentVolume definition instructs Kubernetes to expose the underlying storage resource as a raw block device directly to the consuming pod. This bypasses the traditional filesystem layer, allowing applications to perform direct I/O operations on the unformatted volume. This capability is crucial for high-performance applications like databases or custom storage engines that require fine-grained control over storage, making it the correct choice for providing a raw block device.

Why this answer

Setting `volumeMode: Block` in the PersistentVolume spec specifies that the volume is to be presented as a raw block device, without a filesystem. This allows a Pod to mount the volume as a block device (e.g., `/dev/sdb`) rather than a mounted directory, which is required for applications that need direct access to the underlying storage, such as databases or custom storage engines.

Exam trap

The trap here is that candidates often confuse `volumeMode` with `accessModes` or `persistentVolumeReclaimPolicy`, assuming that access modes or reclaim policies control the block device behavior, when in fact only `volumeMode: Block` enables raw block volume mounting.

How to eliminate wrong answers

Option A is wrong because `persistentVolumeReclaimPolicy: Retain` controls what happens to the PV when the PVC is released (e.g., retain, recycle, delete), not how the volume is presented to the Pod. Option B is wrong because `volumeMode: Filesystem` is the default mode that creates a filesystem on the volume, which is the opposite of what is needed for a block device mount. Option C is wrong because `accessModes: ReadWriteOnce` defines the access mode (e.g., single node read-write), not the volume mode; it does not enable block device mounting.

58
MCQhard

A cluster uses a CSI driver for dynamic provisioning. An administrator creates a StorageClass with 'volumeBindingMode: WaitForFirstConsumer' and a PVC. The pod using the PVC is scheduled to a node. However, the PV is never provisioned. What is the most likely cause?

A.The PVC is not bound to a PV because no PV exists.
B.The CSI driver is not installed or malfunctioning.
C.The pod does not have the correct node selector.
D.The StorageClass uses 'Immediate' binding mode.
AnswerB

The StorageClass references a CSI provisioner (e.g., csi.contoso.com), and Kubernetes relies on the external-provisioner sidecar to send CreateVolume RPCs to the CSI driver controller. If that driver controller is not installed, the DaemonSet pods are CrashLooping, or the CSI socket is unavailable, the provisioner cannot create the backend volume, so no PV is bound and the PVC remains Pending with events like 'Failed to provision volume with storage class'. Inspecting the csi-controller logs and the driver DaemonSet status will confirm the malfunction.

Why this answer

When `volumeBindingMode: WaitForFirstConsumer` is set, the PV is not provisioned until a pod using the PVC is scheduled to a node. If the PV is never provisioned after scheduling, the most likely cause is that the CSI driver is not installed or malfunctioning, because the dynamic provisioning request is sent to the CSI driver, and without a functioning driver, the PV creation will fail silently or not occur at all.

Exam trap

The trap here is that candidates may assume 'WaitForFirstConsumer' delays binding indefinitely or that a missing PV is the root cause, rather than recognizing that dynamic provisioning requires a functioning CSI driver to create the PV after scheduling.

How to eliminate wrong answers

Option A is wrong because dynamic provisioning creates a PV on demand; the absence of a pre-existing PV is expected and not a problem. Option C is wrong because the pod's node selector does not affect the CSI driver's ability to provision the PV; the issue is with the driver itself. Option D is wrong because the StorageClass explicitly uses 'WaitForFirstConsumer' binding mode, not 'Immediate', so this option describes a configuration that is not present.

59
Multi-Selecthard

Which THREE of the following are characteristics of a StatefulSet's volumeClaimTemplates?

Select 3 answers
A.When a Pod is deleted, the corresponding PVC is automatically deleted.
B.The PVCs are created in the same namespace as the StatefulSet.
C.Each PVC gets a unique name derived from the template name and the Pod ordinal.
D.They are used to automatically create PersistentVolumeClaims for each replica.
E.The volumeClaimTemplate must specify a storageClassName.
AnswersB, C, D

PersistentVolumeClaims are namespace-scoped objects, just like StatefulSets, Pods, and Services. When a StatefulSet defines volumeClaimTemplates, the StatefulSet controller creates the resulting PVCs in the same namespace in which the StatefulSet itself is created, ensuring that Pods and their volumes exist in the same Kubernetes namespace. This namespace isolation is a fundamental part of Kubernetes identity and access control: PVs are cluster-scoped, but PVCs cannot cross namespaces, and a Pod can only mount a PVC from its own namespace. Consequently, the PVCs are inevitably co-located with the StatefulSet.

Why this answer

Option B is correct because volumeClaimTemplates generate PersistentVolumeClaims within the same namespace as the owning StatefulSet, since PVCs are namespaced resources and cannot cross namespace boundaries. Option C is correct because each generated PVC follows the naming convention <template-name>-<statefulset-name>-<ordinal>, giving every replica a unique, stable PVC tied to its Pod ordinal. Option D is correct because the core purpose of volumeClaimTemplates is to automatically provision a PersistentVolumeClaim for each StatefulSet replica, ensuring stable per-Pod storage.

Option A is not correct because StatefulSet PVCs are retained by default when a Pod is deleted (only scale-down or deletion with the right policy may remove them), so automatic deletion is not a characteristic. Option E is not correct because storageClassName is optional in a volumeClaimTemplate; if omitted, the cluster's default StorageClass is used.

Exam trap

The trap here is that candidates often assume PVCs are ephemeral like Pods, but StatefulSets intentionally preserve PVCs to guarantee data persistence across Pod lifecycle events.

60
MCQeasy

Which of the following is a valid CSI (Container Storage Interface) driver operation in Kubernetes?

A.CreateVolume
B.CreateDeployment
C.CreateService
D.CreatePod
AnswerA

CreateVolume is a core gRPC method defined in the Container Storage Interface (CSI) Controller service specification. It is invoked by the Kubernetes external-provisioner sidecar to provision a new physical or virtual storage volume on the underlying storage provider before it can be attached to a node.

Why this answer

The Container Storage Interface (CSI) defines a set of standard operations that storage drivers must implement to provision, attach, mount, and manage volumes in container orchestrators like Kubernetes. `CreateVolume` is a core CSI RPC (Remote Procedure Call) that the CSI driver must support to dynamically create a new storage volume, which is then used by Kubernetes to satisfy a PersistentVolumeClaim. This operation is defined in the CSI specification and is essential for dynamic volume provisioning.

Exam trap

The trap here is that candidates confuse Kubernetes API resource operations (like creating a Pod or Service) with the low-level CSI driver RPCs, which are not directly exposed as kubectl commands but are internal gRPC calls between Kubernetes components and the driver.

How to eliminate wrong answers

Option B (CreateDeployment) is wrong because it is a Kubernetes API object for managing replicated pods, not a CSI driver operation. Option C (CreateService) is wrong because it is a Kubernetes abstraction for network access to pods, not a storage-related CSI operation. Option D (CreatePod) is wrong because it is a Kubernetes primitive for running containers, and pod creation does not involve a CSI driver RPC; CSI operations are invoked by the kubelet or external provisioner, not directly by creating a pod.

61
MCQeasy

A developer accidentally runs 'kubectl delete pvc data-claim'. What is the immediate effect on the PersistentVolume pv-data?

A.The PV pv-data is automatically deleted.
B.The PV pv-data remains Bound to the deleted PVC.
C.The PV pv-data immediately becomes Available and can be reused.
D.The PV pv-data enters the Released state and is not deleted.
AnswerD

With the Retain reclaim policy configured, deleting the bound PVC causes the PV to enter the Released state rather than being deleted or recycled. This means the PV still exists and its underlying storage resources—such as disk data—remain intact, but it is no longer bound to any claim. The PV will remain in Released status until an administrator manually intervenes, typically by deleting the PV and recreating it or by editing its claimRef to allow rebinding. This preserves data for recovery but leaves the PV unused until explicit manual action is taken.

Why this answer

When a PVC is deleted, the associated PV enters the 'Released' state, not 'Available'. This is because the PV still contains data from the previous claim (the retain policy is 'Retain' by default), and Kubernetes does not automatically delete or reuse it. The PV remains in 'Released' until an administrator manually clears the claimRef or deletes the PV.

Exam trap

The trap here is that candidates assume the PV's reclaim policy is 'Delete' by default, or that deleting a PVC automatically makes the PV 'Available' for reuse, when in fact the default policy is 'Retain' and the PV enters 'Released'.

How to eliminate wrong answers

Option A is wrong because the PV is not automatically deleted when the PVC is deleted; the PV's lifecycle is independent and depends on its reclaim policy (default is 'Retain'). Option B is wrong because the PV does not remain 'Bound' to the deleted PVC; the binding is removed, and the PV transitions to 'Released'. Option C is wrong because the PV does not immediately become 'Available'; it enters 'Released' and cannot be reused until the claimRef is manually cleared by an administrator.

62
Multi-Selectmedium

Which THREE statements about StorageClasses are true?

Select 3 answers
A.Only cluster administrators can create StorageClasses.
B.StorageClasses are namespaced resources.
C.A StorageClass can specify a provisioner to enable dynamic volume provisioning.
D.The volumeBindingMode in a StorageClass can be set to 'WaitForFirstConsumer' to delay PV creation until a pod uses the PVC.
E.A StorageClass can set the reclaim policy for dynamically provisioned PVs.
AnswersC, D, E

A StorageClass's 'provisioner' field specifies the volume plugin responsible for dynamically provisioning PersistentVolumes. For example, 'kubernetes.io/aws-ebs' or 'pd.csi.storage-gke.io' causes the in-tree or CSI driver to create a new storage volume when a PVC references this StorageClass. Without a provisioner, a StorageClass cannot dynamically create PVs and is generally only useful for binding pre-existing PVs.

Why this answer

Option C is correct because a StorageClass defines a provisioner field (for example, kubernetes.io/aws-ebs or a CSI driver name) that tells Kubernetes which plugin should dynamically provision PersistentVolumes when a matching PVC is created. Option D is correct because setting volumeBindingMode: WaitForFirstConsumer defers both PV provisioning and binding until a pod that uses the PVC is scheduled, which allows topology-aware scheduling decisions. Option E is correct because the reclaimPolicy field in a StorageClass (values such as Delete or Retain) sets the reclaim policy applied to PVs that are dynamically provisioned by that class.

Option A is not correct because creating StorageClasses is governed by RBAC, not restricted to cluster administrators; any subject granted the appropriate permissions on the storageclasses resource can create them. Option B is not correct because StorageClasses are cluster-scoped resources, not namespaced, and are referenced by PVCs across namespaces.

Exam trap

The trap here is that candidates often confuse StorageClasses as namespaced resources (like PVCs) or assume only admins can create them, when in fact StorageClasses are cluster-scoped and RBAC-controlled, and the question tests precise knowledge of their configurable fields.

63
MCQhard

A cluster administrator is configuring a Pod to use a PersistentVolumeClaim (PVC) that is dynamically provisioned using a StorageClass with volumeBindingMode: WaitForFirstConsumer. The PVC is created before the Pod. When the Pod is created, which node will the PV be provisioned on?

A.The PV is provisioned immediately on the node specified in the StorageClass's allowedTopologies.
B.The node where the Pod is scheduled.
C.Any node in the cluster that has sufficient resources for the PV.
D.The control plane node.
AnswerB

This option is correct. When a StorageClass uses the WaitForFirstConsumer volume binding mode, the Kubernetes scheduler plays a crucial role. It first finds a suitable node for the Pod, considering all its requirements, including the PVC. Once the Pod is scheduled to a specific node, the PersistentVolume is then dynamically provisioned on that very node, ensuring optimal data locality and performance for the Pod.

Why this answer

When a StorageClass uses volumeBindingMode: WaitForFirstConsumer, the PersistentVolume (PV) is not provisioned until a Pod that uses the PersistentVolumeClaim (PVC) is scheduled. The PV is then provisioned on the exact node where the Pod is scheduled, ensuring that the volume is created in the same zone or topology as the Pod. This avoids unnecessary cross-zone data transfer and ensures the PV is available locally to the Pod's node.

Exam trap

The trap here is that candidates assume PV provisioning happens immediately when the PVC is created, or that it is tied to a specific node defined in the StorageClass, rather than understanding that WaitForFirstConsumer delays provisioning until Pod scheduling and ties it to the Pod's node.

How to eliminate wrong answers

Option A is wrong because allowedTopologies in a StorageClass is used with Immediate binding mode to restrict provisioning to specific zones, but with WaitForFirstConsumer, the PV is provisioned on the node where the Pod is scheduled, not necessarily on a node matching allowedTopologies unless the scheduler enforces it. Option C is wrong because the PV is not provisioned on 'any node with sufficient resources'; it is specifically provisioned on the node where the Pod is scheduled, and the scheduler considers topology constraints from the PVC and StorageClass. Option D is wrong because the control plane node is not involved in PV provisioning for WaitForFirstConsumer; the PV is provisioned on the worker node where the Pod runs, not on the control plane.

64
MCQhard

A cluster administrator manages a PersistentVolume with reclaim policy Retain that was bound to a PersistentVolumeClaim. The application team deletes the PVC, but the administrator later needs to reuse the same underlying storage for a new PVC in the same namespace. After the PVC deletion, the PV shows status Released. Which sequence of actions must the administrator perform to make the PV bindable again?

A.Create a new PVC with the same name as the deleted PVC and the same capacity; Kubernetes will automatically rebind the Released PV.
B.Edit the PV to remove the claimRef field (or set it to null), then create a new PVC that matches the PV's capacity and access modes.
C.Change the PV's reclaim policy to Delete, then delete and recreate the PVC.
D.Delete the PV and recreate it with the same storage backend configuration, then create the new PVC.
AnswerB

A Released PV retains a claimRef pointing to the deleted PVC, which prevents binding to a new claim. Removing the claimRef field makes the PV Available again, allowing a new PVC with matching capacity and access modes to bind. This is the documented reclaim procedure for Retain policy volumes.

Why this answer

Under the Retain policy, deleting a PVC leaves the PV in Released state with a claimRef to the deleted claim. To reuse the storage, the administrator must remove the claimRef so the PV becomes Available, then create a new PVC whose capacity and access modes match. Deleting the PV or changing the reclaim policy risks data loss and does not restore bindability.

Exam trap

The trap here is believing that a Released PV will automatically rebind to a new PVC with the same name, when the stale claimRef must be manually cleared first.

65
MCQhard

An administrator needs to configure dynamic provisioning for persistent volumes using an external CSI driver. Which of the following is the correct approach?

A.Set the 'volumeBindingMode' to 'Immediate' in the PVC.
B.Install the CSI driver and then all PVCs will automatically be provisioned.
C.Create a StorageClass with 'provisioner' set to the CSI driver name.
D.Create a PersistentVolume with the CSI driver name in the 'csi' section.
AnswerC

To enable dynamic provisioning, you must define a 'StorageClass' object where the 'provisioner' field matches the registered name of your CSI driver. When a user submits a 'PersistentVolumeClaim' referencing this 'StorageClass', the Kubernetes volume controller automatically invokes the specified CSI driver to provision the underlying storage asset and create the corresponding 'PersistentVolume' on demand.

Why this answer

Dynamic provisioning in Kubernetes requires a StorageClass object that references the CSI driver as its provisioner. When a PVC requests a StorageClass with a CSI provisioner, the CSI external-provisioner sidecar automatically creates a PersistentVolume and binds it to the PVC. Without the StorageClass, Kubernetes has no way to know which CSI driver should handle the provisioning request.

Exam trap

The trap here is that candidates often think installing the CSI driver alone is sufficient for dynamic provisioning (Option B), but they miss the critical requirement of creating a StorageClass that explicitly links the PVC request to the CSI driver's provisioner name.

How to eliminate wrong answers

Option A is wrong because 'volumeBindingMode' is a field on the StorageClass, not the PVC, and setting it to 'Immediate' controls when binding and dynamic provisioning occur (immediately vs. delayed until pod scheduling), not how the CSI driver is configured. Option B is wrong because simply installing the CSI driver does not enable automatic provisioning; a StorageClass must be created that references the CSI driver's provisioner name, and PVCs must request that StorageClass. Option D is wrong because a PersistentVolume is a static resource that must be manually created or dynamically provisioned; specifying the CSI driver in a PV's 'csi' section is used for static provisioning, not for dynamic provisioning.

66
Multi-Selectmedium

Which TWO of the following are valid reclaim policies for PersistentVolumes?

Select 2 answers
A.Retain
B.Delete
C.Recycle
D.Archive
E.Reuse
AnswersA, B

Retain is a valid reclaim policy because when a PersistentVolume is released from a PersistentVolumeClaim, the underlying storage resource is kept intact. The volume is not automatically removed or scrubbed; instead, it remains in a Released state until a cluster administrator manually intervenes to recover or reuse it. This policy is essential for protecting critical data from accidental deletion.

Why this answer

Option A, Retain, is correct because it is one of the two officially supported PersistentVolume reclaim policies in Kubernetes: when a bound PVC is deleted, the PV is left intact and its data is preserved, requiring manual reclamation. Option B, Delete, is also correct because it is the other supported reclaim policy: it instructs Kubernetes to delete the PV object and, for dynamic provisioners, the underlying storage asset (e.g., an AWS EBS volume or GCE PD) when the PVC is released. Option C, Recycle, is not correct because although it existed as a legacy policy performing a basic scrub (rm -rf /thevolume/*) and making the volume available again, it was deprecated and removed in Kubernetes 1.14.

Option D, Archive, is not a valid reclaim policy at all, and Option E, Reuse, is likewise not a recognized reclaim policy value in the PersistentVolume spec's persistentVolumeReclaimPolicy field, which accepts only Retain, Delete, and formerly Recycle.

Exam trap

The trap here is that candidates may confuse deprecated or non-existent policies (like Recycle or Archive) with valid ones, or assume that Recycle is still supported, when in fact only Retain and Delete are currently valid for the CKA exam.

67
MCQhard

You need to allow a pod to use a specific device from the host node (e.g., /dev/sdb) as a raw block device. Which volume mode should you set in the PVC?

A.Device
B.Raw
C.Block
D.Filesystem
AnswerC

Setting volumeMode: Block on a volume causes Kubernetes to present the backing storage as an unformatted raw block device inside the container. You must attach it through the container's volumeDevices list, providing a devicePath (e.g., /dev/xvdb), rather than using volumeMounts and a mountPath. This is required for workloads such as databases or storage engines that manage their own on-disk layout and want to bypass the filesystem layer entirely. Only Block mode supports this raw device access model.

Why this answer

To use a host device like /dev/sdb as a raw block device inside a pod, the PersistentVolumeClaim (PVC) must specify `volumeMode: Block`. This tells Kubernetes to expose the volume as a raw block device (e.g., /dev/xxx) inside the container, rather than mounting a filesystem. Only the `Block` volume mode supports this behavior, as defined in the Kubernetes PersistentVolume API.

Exam trap

The trap here is that candidates confuse the 'Block' volume mode with the deprecated 'Raw' or 'Device' terminology from other systems, or assume 'Filesystem' is the only option, missing that raw block access requires explicit mode selection.

How to eliminate wrong answers

Option A is wrong because 'Device' is not a valid volume mode in Kubernetes; the valid modes are 'Filesystem' and 'Block'. Option B is wrong because 'Raw' is not a recognized volume mode; the correct term is 'Block' for raw block device access. Option D is wrong because 'Filesystem' is the default volume mode, which mounts a filesystem (e.g., ext4) and does not expose the device as a raw block device.

68
MCQmedium

A cluster administrator creates a StorageClass with the following YAML: apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: fast provisioner: kubernetes.io/aws-ebs parameters: type: gp2 reclaimPolicy: Delete volumeBindingMode: Immediate A developer creates a PVC using this StorageClass. The PVC is created and remains in Pending state. What is the most likely cause?

A.The volumeBindingMode is Immediate, which requires a different access mode.
B.The cluster is not running on AWS or the AWS cloud provider is not configured.
C.The PVC does not specify an access mode.
D.The reclaim policy is Delete, which prevents binding.
AnswerB

The `kubernetes.io/aws-ebs` provisioner is specifically designed to interact with the AWS EC2 API to create EBS volumes. For this provisioner to function correctly, the Kubernetes cluster must be running within an AWS environment, and the `kube-controller-manager` must be configured with the AWS cloud provider integration. If the cluster is not on AWS, or if the cloud provider integration is misconfigured or missing, the provisioner cannot authenticate or make API calls to AWS, leading to the PVC remaining in a `Pending` state indefinitely as it cannot provision the underlying storage.

Why this answer

The StorageClass uses the provisioner `kubernetes.io/aws-ebs`, which is specific to the AWS cloud provider. If the cluster is not running on AWS or the AWS cloud provider is not properly configured (e.g., missing IAM roles, cloud-controller-manager not running), the provisioner cannot create the underlying EBS volume, leaving the PVC in a Pending state indefinitely.

Exam trap

The trap here is that candidates may focus on PVC spec details like access modes or reclaim policies, but the core issue is that the provisioner is incompatible with the underlying infrastructure, which is a common real-world misconfiguration tested in the CKA Storage domain.

How to eliminate wrong answers

Option A is wrong because `volumeBindingMode: Immediate` does not require a specific access mode; it simply means binding and provisioning happen as soon as the PVC is created, regardless of pod scheduling. Option C is wrong because the PVC can still be created and bound even if it does not specify an access mode; the access mode is a required field in the PVC spec, but its absence would cause a validation error, not a Pending state after creation. Option D is wrong because the `reclaimPolicy: Delete` does not prevent binding; it only determines what happens to the PV when the PVC is deleted, and has no effect on the initial binding process.

69
MCQmedium

You want to dynamically provision storage for a PVC using a StorageClass named 'fast-ssd'. Which field in the PVC YAML specifies the StorageClass?

A.class
B.storageClass
C.className
D.storageClassName
AnswerD

The field storageClassName is the correct, canonical way to reference a StorageClass in a PersistentVolumeClaim. It tells the Kubernetes scheduler which StorageClass should be used to dynamically provision a PersistentVolume for this claim. If the StorageClass exists and is available, the provisioner associated with it creates the underlying storage, and the PV is bound to the PVC. If storageClassName is not specified, the cluster's default StorageClass is used, but explicit specification ensures the desired class is selected. This field is part of the PVC spec and is crucial for controlling storage characteristics like performance, reclaim policy, and provisioner.

Why this answer

In Kubernetes, the field that specifies which StorageClass to use for dynamic provisioning in a PersistentVolumeClaim (PVC) is `storageClassName`. When this field is set to a valid StorageClass name (e.g., 'fast-ssd'), the system will dynamically provision a PersistentVolume using the provisioner and parameters defined in that StorageClass. If omitted, the default StorageClass (if one exists) is used.

Exam trap

The trap here is that candidates often confuse the field name `storageClassName` with similar-sounding terms like `storageClass` or `className`, or they assume a generic `class` field exists, leading them to pick a plausible but incorrect option.

How to eliminate wrong answers

Option A is wrong because `class` is not a valid field in a PVC spec; it is a legacy term from earlier versions and is not recognized by the Kubernetes API. Option B is wrong because `storageClass` (camelCase) is not the correct field name; the API uses `storageClassName` (all lowercase with 'Name' appended). Option C is wrong because `className` is not a field in the PVC spec; it might be confused with a field in other Kubernetes resources (e.g., Ingress) but does not apply to PVCs.

70
MCQeasy

A developer wants to mount a ConfigMap as a volume in a pod. However, the pod should only see specific keys from the ConfigMap, not all keys. What is the best approach?

A.Use the ConfigMap to set environment variables instead of a volume mount.
B.Use the 'items' field in the ConfigMap volume definition to specify which keys to include.
C.Mount the entire ConfigMap and use a startup script to remove unwanted files.
D.Create a new ConfigMap with only the needed keys.
AnswerB

The `items` field within a ConfigMap volume definition is the precise and recommended method for selectively exposing specific keys as files inside a container. By specifying `key` and `path` for each desired entry, only the relevant data from the ConfigMap is mounted into the pod's filesystem, preventing unnecessary data exposure. This approach ensures minimal resource usage and adheres to the principle of least privilege by only providing what is strictly required. For example, `items: [{key: "app-config.yaml", path: "config.yaml"}]` mounts only the `app-config.yaml` key as `config.yaml`.

Why this answer

The `items` field in a ConfigMap volume definition allows you to selectively project only specific keys from the ConfigMap into the pod's filesystem. This is the native Kubernetes mechanism for controlling which keys appear as files, avoiding the need to mount the entire ConfigMap or create a separate ConfigMap.

Exam trap

The trap here is that candidates often confuse the `items` field with the `optional` field or assume that mounting a ConfigMap always exposes all keys, leading them to choose the wasteful approach of creating a new ConfigMap (Option D) instead of using the built-in selective projection mechanism.

How to eliminate wrong answers

Option A is wrong because using environment variables is a different mechanism that does not address the requirement to mount a ConfigMap as a volume; it also exposes all keys as environment variables unless you manually specify each key, which is not the best approach for selective file projection. Option C is wrong because mounting the entire ConfigMap and then using a startup script to remove unwanted files is an anti-pattern that wastes resources, adds complexity, and violates the principle of declarative configuration. Option D is wrong because creating a new ConfigMap with only the needed keys duplicates data and increases management overhead, whereas the `items` field achieves the same goal without creating additional objects.

71
Multi-Selectmedium

Which TWO of the following are required fields in a PersistentVolumeClaim spec? (Select TWO)

Select 2 answers
A.storageClassName
B.selector
C.accessModes
D.volumeMode
E.resources.requests.storage
AnswersC, E

accessModes is a mandated field for both PersistentVolumes and PersistentVolumeClaims, and it must contain at least one valid access mode such as ReadWriteOnce, ReadOnlyMany, or ReadWriteMany. Kubernetes uses these modes to enforce how many nodes can mount the volume and whether it can be mounted read-only. Without this field, the API server will reject the claim because there is no way to determine the volume's intended access semantics.

Why this answer

Option C (accessModes) is correct because a PersistentVolumeClaim must declare how the volume will be mounted (e.g., ReadWriteOnce, ReadOnlyMany, ReadWriteMany), and this field is mandatory in the PVC spec. Option E (resources.requests.storage) is correct because the claim must specify the amount of storage it requests (e.g., 5Gi), which the control plane uses to bind a matching PersistentVolume. Option A (storageClassName) is not required since it can be omitted, in which case the default StorageClass is used or binding falls back to matching without a class.

Option B (selector) is optional and only used to further constrain which PersistentVolumes can satisfy the claim via label matching. Option D (volumeMode) is optional and defaults to Filesystem when not specified.

Exam trap

The trap here is that candidates often assume `storageClassName` is required because it is commonly used, but the CKA exam tests that only `accessModes` and `resources.requests.storage` are mandatory per the Kubernetes API spec.

72
MCQmedium

A cluster administrator wants to provide storage for an application that requires reading and writing by multiple pods simultaneously. The storage backend is an NFS server that supports multiple writers. Which access mode should be specified in the PersistentVolume?

A.ReadOnlyMany
B.ReadWriteOnce
C.ReadWriteOncePod
D.ReadWriteMany
AnswerD

ReadWriteMany (RWX) is the correct access mode because it allows multiple pods to mount the volume simultaneously with both read and write access, regardless of which nodes those pods run on. This is the only standard access mode that satisfies the requirement of shared read-write storage for many pods. RWX is typically supported by network-based storage like NFS, CephFS, or GlusterFS, and is essential for applications such as clustered web servers or shared content management systems.

Why this answer

The correct access mode is ReadWriteMany (RWX) because the application requires multiple pods to read and write simultaneously, and the NFS server supports multiple writers. RWX allows the PersistentVolume to be mounted as read-write by many nodes, which is the only access mode that satisfies the requirement for concurrent read-write access from multiple pods.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (RWO) with the ability to support multiple pods, forgetting that RWO restricts access to a single node, not just a single pod, and that ReadWriteMany (RWX) is required for multi-pod write access across nodes.

How to eliminate wrong answers

Option A is wrong because ReadOnlyMany (ROX) allows multiple pods to mount the volume, but only in read-only mode, which does not satisfy the write requirement. Option B is wrong because ReadWriteOnce (RWO) allows only a single node to mount the volume as read-write, preventing multiple pods on different nodes from writing simultaneously. Option C is wrong because ReadWriteOncePod (RWOP) restricts the volume to a single pod on a single node, which explicitly prevents multiple pods from accessing it concurrently.

73
MCQmedium

An administrator is preparing a StorageClass for a stateful application. The cluster's default StorageClass uses immediate binding, which causes PersistentVolumes to be provisioned before the consuming Pod is scheduled. The administrator wants volumes to be provisioned only after the scheduler has selected a node, so that topology-aware constraints (such as zone-local disks) can be honored. Which change to the StorageClass should the administrator make?

A.Set volumeBindingMode to Immediate and add a nodeSelector to the StorageClass.
B.Add a topologyKey field to the StorageClass and set it to kubernetes.io/hostname.
C.Set volumeBindingMode to WaitForFirstConsumer in the StorageClass specification.
D.Set reclaimPolicy to Retain and set allowVolumeExpansion to true.
AnswerC

WaitForFirstConsumer delays binding and provisioning until a Pod using the PVC is scheduled, allowing the scheduler to consider the Pod's node affinity and topology constraints. This prevents provisioning a volume in the wrong zone. It is the correct field for topology-aware dynamic provisioning and directly addresses the scenario's requirement.

Why this answer

WaitForFirstConsumer is the volumeBindingMode value that defers both binding and dynamic provisioning until a Pod using the PVC is scheduled, letting the scheduler choose a node that satisfies the Pod's topology constraints. Immediate binding provisions too early for zone-local storage. The other options either use unrelated StorageClass fields or fields that do not exist.

Exam trap

The trap here is assuming that adding a topology key directly to the StorageClass controls provisioning location, when topology awareness is actually driven by volumeBindingMode and the CSI driver's topology support.

74
MCQhard

Refer to the exhibit. A pod is defined with an emptyDir volume using memory medium. The pod is scheduled on a node with 4 GB of RAM. The container writes 3 GB of data to /cache. What will happen?

A.The container will be throttled by the kernel's memory management.
B.The pod will be evicted because emptyDir with memory is not allowed to use more than 1 GB.
C.The pod will be OOMKilled because the emptyDir memory usage exceeds the default limit.
D.The pod will run normally because there is no memory limit and the node has sufficient RAM.
AnswerD

When an emptyDir volume is configured with medium: Memory, Kubernetes mounts a tmpfs filesystem that consumes the host node's RAM. Because the pod has no defined memory limits and the 3 GB of written data fits within the node's 4 GB of physical RAM, the operation completes successfully. The pod will continue to run normally without triggering eviction or OOM termination.

Why this answer

An emptyDir volume with `medium: Memory` creates a tmpfs filesystem that uses the node's RAM, but it does not impose any inherent limit on how much memory the container can consume via that volume. Since the pod has no memory limit set (no `resources.limits.memory`), the container can write up to the node's available memory (4 GB) without being throttled or killed, as long as the node has sufficient free RAM.

Exam trap

The trap here is that candidates assume emptyDir with `medium: Memory` has a default limit or triggers OOMKill, when in fact it only uses node memory and is constrained only by explicit `sizeLimit` or node capacity.

How to eliminate wrong answers

Option A is wrong because kernel memory throttling only applies when a cgroup memory limit is configured; without a limit, the container can use memory freely until the node runs out. Option B is wrong because there is no default 1 GB limit for emptyDir with memory; the size is bounded only by the node's memory capacity unless explicitly restricted via `sizeLimit`. Option C is wrong because OOMKilling occurs when a container exceeds its memory limit (set via `resources.limits.memory`) or when the node is under memory pressure; here, no limit is set and the node has sufficient RAM, so no OOMKill will occur.

75
MCQmedium

A developer creates a PVC with storageClassName: "" (empty string). What does this mean?

A.The PVC will remain pending indefinitely
B.The PVC will use the default StorageClass
C.The PVC will be dynamically provisioned using the cluster's default StorageClass
D.The PVC will only bind to PVs that also have storageClassName: ""
AnswerD

Setting storageClassName: "" on a PVC restricts binding exclusively to PersistentVolumes that also have their storageClassName set to an empty string or omitted. This behavior ensures that the PVC bypasses dynamic provisioning entirely. It allows the PVC to bind only to statically created PVs that represent pre-existing physical storage assets.

Why this answer

When a PVC has `storageClassName: ""` (empty string), it explicitly disables dynamic provisioning and static binding to a PV that also has `storageClassName: ""`. This means the PVC will only bind to a pre-existing PV that has its `storageClassName` set to an empty string, bypassing any default StorageClass. It does not remain pending indefinitely, nor does it use or trigger the default StorageClass.

Exam trap

The trap here is that candidates often confuse an empty string `""` with omitting the field entirely, assuming it will fall back to the default StorageClass, but Kubernetes treats them as distinct: omitted means 'use default', while empty string means 'disable default and require exact match'.

How to eliminate wrong answers

Option A is wrong because the PVC will not remain pending indefinitely; it will bind to a PV with `storageClassName: ""` if one exists, or remain pending only until such a PV is created. Option B is wrong because setting `storageClassName: ""` explicitly overrides the default StorageClass; the PVC will not use it. Option C is wrong because dynamic provisioning is disabled when `storageClassName` is set to an empty string; the PVC will not be dynamically provisioned by any StorageClass, including the default.

Page 1 of 2 · 84 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Cka Storage questions.