KCNA · Domain 2: Container Orchestration · 28% of the exam
Task 2.4: Storage
Volumes and ephemeral storage, PersistentVolumes and claims, access modes and reclaim policies, StorageClasses and dynamic provisioning, CSI drivers, snapshots, and storage for StatefulSets.
Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.
Question 1 · choose 1
A Pod keeps a scratch cache on disk. The cache must survive a crash and restart of the container, but it may be thrown away when the Pod is removed from its node. Which volume fits with the least setup?
AThe container's writable layer
BA claim on a PersistentVolume with the Retain policy
CA hostPath volume on the node
DAn emptyDir volume in the Pod spec
Show the answer and why
AThe container's writable layer
Incorrect
After a crash the kubelet restarts the container with a clean state, so files written there are lost.
BA claim on a PersistentVolume with the Retain policy
Incorrect
That keeps data well beyond the Pod's life and needs storage provisioning, which is more than this cache needs.
CA hostPath volume on the node
Incorrect
hostPath ties the Pod to a node's filesystem and outlives the Pod; it carries security risks and is not meant for scratch data.
DAn emptyDir volume in the Pod spec
Correct
An emptyDir lives as long as the Pod. A container crash does not remove the Pod, so the data survives restarts, and it is deleted when the Pod leaves the node.
Scratch space shared for the Pod's lifetime is what emptyDir provides; persistent storage is for data that must outlive the Pod.
Two Pods of a content service run on different nodes, and both must write to the same shared directory at the same time. Which access mode must the PersistentVolume and its claim support?
AReadWriteOnce
BReadOnlyMany
CReadWriteMany
DReadWriteOncePod
Show the answer and why
AReadWriteOnce
Incorrect
ReadWriteOnce allows read-write mounting by a single node, so the second Pod on another node could not write.
BReadOnlyMany
Incorrect
ReadOnlyMany allows many nodes but only for reading.
CReadWriteMany
Correct
ReadWriteMany lets the volume be mounted read-write by many nodes at once.
DReadWriteOncePod
Incorrect
ReadWriteOncePod restricts read-write access to a single Pod in the whole cluster.
Access modes describe how many nodes or Pods may mount a volume and whether they may write; shared writes across nodes need ReadWriteMany and a storage backend that supports it.
Developers wait days for an administrator to create a PersistentVolume each time they need storage. The team wants a claim to get a new volume created automatically. What should the administrator set up?
AA larger pool of PersistentVolumes created ahead of time by hand
BA StorageClass with a provisioner that the claims name
CA ResourceQuota on requests.storage in each namespace
DAn emptyDir volume in each Pod that needs storage
Show the answer and why
AA larger pool of PersistentVolumes created ahead of time by hand
Incorrect
Pre-creating volumes is static provisioning; it shortens the wait but still needs an administrator to keep the pool filled.
BA StorageClass with a provisioner that the claims name
Correct
Dynamic provisioning creates a volume on demand when a claim names a StorageClass whose provisioner can create it.
CA ResourceQuota on requests.storage in each namespace
Incorrect
A quota caps how much storage a namespace may claim; it creates nothing.
DAn emptyDir volume in each Pod that needs storage
Incorrect
emptyDir is scratch space that disappears with the Pod, not a provisioned persistent volume.
StorageClasses describe kinds of storage and the provisioner that creates them, which lets claims trigger volume creation on demand.
A database runs as a StatefulSet with three replicas and a volumeClaimTemplates entry, and its persistentVolumeClaimRetentionPolicy is left at the default. Which two behaviors should the team expect? (Choose TWO.)
AThe three replicas share one claim created from the template
BScaling down from three replicas to two deletes the third replica's claim at once
CThe claims are created in the kube-system namespace
DEach replica gets its own PersistentVolumeClaim
EA replacement Pod for a replica mounts the claim that replica used before
Show the answer and why
AThe three replicas share one claim created from the template
Incorrect
The template is stamped out once per Pod; replicas do not share one claim.
BScaling down from three replicas to two deletes the third replica's claim at once
Incorrect
The default retention policy is Retain, so claims stay when the set scales down unless the policy is changed.
CThe claims are created in the kube-system namespace
Incorrect
Claims are created in the StatefulSet's own namespace, next to the Pods that use them.
DEach replica gets its own PersistentVolumeClaim
Correct
For each volumeClaimTemplates entry, every Pod in the StatefulSet receives its own claim.
EA replacement Pod for a replica mounts the claim that replica used before
Correct
When a Pod is rescheduled, its volume mounts use the claims tied to its identity, so the data comes back with it.
StatefulSets give each replica stable storage: one claim per Pod per template, reattached when the Pod comes back, and kept by default when the set shrinks or is deleted.
A ConfigMap has the keys app.properties and log.level, and a Pod mounts it as a volume at /etc/config without listing any items. What does the container see there?
AOne file named configmap.yaml that holds both keys
BEnvironment variables named after the two keys
CTwo files, app.properties and log.level
DAn empty directory until the keys are listed under items
Show the answer and why
AOne file named configmap.yaml that holds both keys
Incorrect
The ConfigMap object is not written out as one YAML file; its keys are projected one by one.
BEnvironment variables named after the two keys
Incorrect
Keys become environment variables through the container's environment settings in the Pod spec, not through a volume.
CTwo files, app.properties and log.level
Correct
Each key in the ConfigMap's data becomes a file name under the mount path, with the value as the file's content.
DAn empty directory until the keys are listed under items
Incorrect
items is optional and places chosen keys at specific paths; a plain mount without it projects every key in the ConfigMap as a file.
A mounted ConfigMap turns each key into a file, which suits applications that read configuration files. The optional items field places chosen keys at specific paths, and mounted keys are refreshed after the ConfigMap changes.
A claim bound to a PersistentVolume with reclaimPolicy Retain is deleted. The volume now shows status Released, and a new claim does not bind to it. Why?
AReleased volumes are deleted automatically within an hour
BIt still holds the old data and waits to be reclaimed by an admin
CThe new claim must use the old claim's name
DThe volume must be expanded before it can bind again
Show the answer and why
AReleased volumes are deleted automatically within an hour
Incorrect
With Retain, nothing deletes the volume automatically.
BIt still holds the old data and waits to be reclaimed by an admin
Correct
Released means the claim is gone but the resource is not yet reclaimed; it is not available for another claim.
CThe new claim must use the old claim's name
Incorrect
Names do not reconnect a released volume.
DThe volume must be expanded before it can bind again
Incorrect
Size is not the problem; its released state is.
Retained volumes move to Released and wait for manual cleanup before they can be used again.