Your team is containerizing a three-node ZooKeeper ensemble on a GKE Standard cluster. Each node must keep its own data directory on a PersistentVolumeClaim, start in sequence so the first node can become the initial leader, and advertise a stable DNS name (zookeeper-0, zookeeper-1, zookeeper-2) that clients can rely on even after rescheduling. Which Kubernetes workload resource should you create to meet these requirements with the least custom scripting?
Create a ReplicaSet and rely on an init container to assign ordinal pod names.
Create a DaemonSet so each node automatically runs one ZooKeeper pod with local storage.
Create a Deployment of three replicas and mount a ReadWriteMany PersistentVolume.
Create a StatefulSet with three replicas and a PVC template for the data directory.
A StatefulSet automatically assigns stable, ordinal pod names, maintains a 1-to-1 mapping between each pod and its PersistentVolumeClaim, and starts pods in ordinal order by default (and deletes them in reverse order). These behaviors are exactly what distributed systems like ZooKeeper need for quorum formation and persistent identity. Deployments and ReplicaSets manage identical, interchangeable pods without ordering guarantees or stable identities. A DaemonSet schedules one pod per node but likewise provides no ordered startup or persistent identity guarantees, and it would run as many ZooKeeper instances as there are nodes rather than exactly three.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a StatefulSet in Kubernetes?
Open an interactive chat with Bash
How does a PersistentVolumeClaim (PVC) work in Kubernetes?
Open an interactive chat with Bash
Why does ZooKeeper require stable DNS names and sequential startup?
Open an interactive chat with Bash
What is a StatefulSet in Kubernetes?
Open an interactive chat with Bash
Why is ordinal startup sequence important for ZooKeeper?
Open an interactive chat with Bash
What is a PersistentVolumeClaim (PVC) in Kubernetes?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .