Kubernetes and Cloud Native Associate (KCNA)Kubernetes FundamentalsMedium

A developer needs to deploy a database application that requires stable, unique network identifiers and ordered scaling/updates for its Pods. Which Kubernetes workload object is specifically designed to manage such stateful applications?

  1. ADaemonSet
  2. BDeployment
  3. CStatefulSet
  4. DReplicaSet
Show answer & explanation

Correct answer: C. StatefulSet

StatefulSets are designed to manage stateful applications, providing stable persistent storage, stable network identifiers, and ordered, graceful deployment and scaling. This makes them ideal for databases and other applications requiring unique identities.

Why the other options are wrong

  • A. DaemonSets ensure a Pod runs on every (or selected) node, typically for cluster-level services, not for managing stateful application instances.
  • B. Deployments are for stateless applications and don't guarantee stable identities or ordered operations.
  • D. ReplicaSets ensure a specified number of Pod replicas are running but don't provide stable identities or ordered operations for stateful applications.

Kubernetes StatefulSet

A Kubernetes workload API object used to manage stateful applications, providing stable network identities, ordered deployment/scaling, and persistent storage.

  • Ensures stable, unique network identifiers for Pods (e.g., `web-0`, `web-1`).
  • Guarantees ordered, graceful deployment and scaling.
  • Often used with PersistentVolumes for stable storage.

Memory trick: StatefulSets give your Pods a 'stable state' and 'identity'.

More Kubernetes Fundamentals questions