Skip to main content
InterviewHubPRO
Section Overview
Q44

Question 44 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

88%
Kubernetes (K8s) (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

StatefulSets and Headless Services.

senior LevelSecurity & Auth

In Simple Words: Deployments treat Pods as interchangeable cattle. StatefulSets treat Pods as unique pets:

  • Stable Identity: Pods are named sequentially (mysql-0, mysql-1, mysql-2) and started/terminated in strict ordinal order.
  • volumeClaimTemplates: Provisions a dedicated, unique Persistent Volume for each individual Pod that re-attaches to the exact same Pod ordinal across rescheduling.
  • Headless Service (clusterIP: None): Returns the direct Pod IP addresses via internal DNS A-records, allowing distributed databases (Kafka, Cassandra) to discover peers directly.