CKA Storage Practice Question
Which THREE of the following are characteristics of a StatefulSet's volumeClaimTemplates?
⚠ Common exam trap
It's easy for candidates to assume PVCs are ephemeral like Pods, but StatefulSets intentionally preserve PVCs to guarantee data persistence across Pod lifecycle events.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The PVCs are created in the same namespace as the StatefulSet.
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.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
When a Pod is deleted, the corresponding PVC is automatically deleted.
Why it's wrong here
When a Pod managed by a StatefulSet is deleted, the PersistentVolumeClaim that backs its volume is not deleted as part of Pod lifecycle. PVCs are independent resources with their own lifecycle; the StatefulSet controller only manages Pods and PVCs during scale-down or re-creation, but the default behavior is to retain PVCs to preserve data. This is critical for stateful workloads: even if a Pod is rescheduled or deleted, the same PVC is reattached because its binding to a specific PV remains intact. You must explicitly delete a PVC to remove the underlying storage, unless you have a cleanup policy such as in an operator.
- ✓
The PVCs are created in the same namespace as the StatefulSet.
Why this is correct
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.
- ✓
Each PVC gets a unique name derived from the template name and the Pod ordinal.
Why this is correct
Each PVC produced by a volumeClaimTemplate follows a deterministic naming scheme: `<volumeClaimTemplate name>-<statefulset name>-<ordinal>`. For a StatefulSet named `postgres` with a template named `data`, the PVCs are named `data-postgres-0`, `data-postgres-1`, and so on. This serves as the stable identifier for each Pod's storage: the ordinal in the name guarantees that when a Pod is recreated, it will bind to the exact same PVC (and consequently the same PV) that was previously used by that ordinal. Without this predictable naming, Kubernetes would not be able to preserve the identity of stateful data across Pod restarts or rescheduling events.
- ✓
They are used to automatically create PersistentVolumeClaims for each replica.
Why this is correct
The `volumeClaimTemplates` field in a StatefulSet spec makes the StatefulSet controller automatically provision a PVC for each replica at creation time. This is distinct from a Deployment or ReplicaSet, which merely has a Pod template and does not create any PersistentVolumeClaims by itself; you would have to define PVCs separately and then reference them in the pod spec. Each resulting PVC is based on the template's `spec` (access modes, resources, storage class, etc.), and is created in the same namespace as the StatefulSet. Because this happens automatically, operators only need to declare the storage template once, and the StatefulSet controller handles the rest, binding each replica to its own unique PVC.
- ✗
The volumeClaimTemplate must specify a storageClassName.
Why it's wrong here
Specifying a `storageClassName` in a volumeClaimTemplate is optional, not mandatory. If it is omitted, the default StorageClass configured in the cluster is used when the PVC is created, provided a default StorageClass exists. If no default is defined, the PVC may remain in a Pending state waiting for a matching provisioner; alternatively, you can explicitly set `storageClassName` to `""` to force the use of no StorageClass (only local static PVs). Therefore, stating that the template must specify a storageClassName is factually incorrect, as the StatefulSet controller does not require it to generate PVCs.
Go deeper
Related to this question
Learn chapter
Storage Basics and Volumes
Key term
Storage Classes
A Storage Class in Kubernetes is a template that defines how persistent storage is provisioned automatically, including the type of storage, performance characteristics, and provisioning policies.
Key term
Persistent Volumes
A Persistent Volume is a piece of storage in a Kubernetes cluster that has been provisioned by an administrator and exists independently of any single pod that uses it.
About these practice questions
Courseiva writes every CKA question from scratch — 726 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKA exam.