Courseiva
Storage →mediumMultiple Choice

CKA Storage Practice Question

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?

⚠ Common exam trap

It's easy for candidates to 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.

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

✓

StatefulSet with a volumeClaimTemplate

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.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    ReplicaSet with emptyDir volumes

    Why it's wrong here

    ReplicaSets are designed for stateless workloads and do not guarantee stable network identities or persistent storage bindings. Using emptyDir volumes means that any data written by Cassandra is strictly tied to the Pod's lifecycle; if a Pod is deleted or rescheduled, its data is permanently lost, violating Cassandra's durability requirements.

  • ✗

    DaemonSet with hostPath volumes

    Why it's wrong here

    While DaemonSets run a pod on every node, coupling Cassandra to hostPath volumes creates a tight, fragile dependency on specific physical nodes. If a node fails or undergoes maintenance, the Cassandra pod cannot be rescheduled to another node while retaining access to its local data, leading to potential data loss and cluster degradation.

  • ✓

    StatefulSet with a volumeClaimTemplate

    Why this is correct

    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.

  • ✗

    Deployment with a single PersistentVolume shared by all pods

    Why it's wrong here

    Deployments are intended for stateless applications and cannot dynamically provision unique volumes per replica. Forcing multiple Cassandra instances to share a single PersistentVolume using ReadWriteMany access mode will cause severe file lock conflicts, data corruption, and performance degradation, as Cassandra's storage engine expects exclusive access to its data directory.

Go deeper

Related to this question

About these practice questions

This CKA question is part of Courseiva's 726-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.