StatefulSet
A StatefulSet is a Kubernetes workload resource that manages stateful Pods with stable identities, ordered operations, and persistent storage associations.
Kubernetes in Action, Second Edition
A StatefulSet is a Kubernetes resource that manages stateful pods with stable identities and ordered deployment or scaling.
- How it is used
- Manages stateful application replicas whose individual identities, storage, and network names must persist across pod replacement.
- How deep it goes
- Works through creation, inspection, replacement, node failure, and update procedures, while leaving fuller stateful-workload automation to Operators.
- Examples
- Uses a three-replica quiz application with MongoDB, kubectl inspection, pod deletion, node failure, and a partitioned canary rollout.
- What you can do after
- Operate/configure it with manifests and kubectl to inspect replicas, preserve pod identity, and stage updates.
Read how Kubernetes in Action, Second Edition explains StatefulSet →
Road to Kubernetes
A StatefulSet is a Kubernetes workload resource that manages stateful Pods with stable identities, ordered deployment, and persistent storage associations.
- How it is used
- Manages stateful Pod replicas, particularly data stores that need a separate storage volume for each replica.
- How deep it goes
- Works through a PostgreSQL manifest and its storage, initialization, and access configuration, but leaves database clustering outside scope.
- Examples
- Uses a PostgreSQL StatefulSet with a 20Gi volume claim template, Secret-backed settings, and a ClusterIP Service.
- What you can do after
- Build it from scratch as a PostgreSQL StatefulSet with per-replica storage and internal service access.
Kubernetes for Developers
A StatefulSet is a Kubernetes workload resource that manages stateful Pods with stable identities and persistent storage associations.
- How it is used
- Manages multi-Pod stateful services when each Pod needs its own disk and stable identity.
- How deep it goes
- Explains volume templates, PVCs, ordinals, and ordering through a configured Redis deployment, then addresses disk recovery.
- Examples
- Uses a three-Pod Redis primary-and-replica configuration, read/write checks, and a retained-disk recovery exercise.
- What you can do after
- Build it from scratch as a multirole Redis StatefulSet and recover its data by retaining and relinking disk resources.
Google Anthos in Action
A Kubernetes StatefulSet is a resource that manages replicated pods with stable identities and persistent storage associations.
- How it is used
- Deploys migrated stateful applications whose Pods require durable storage associations.
- How deep it goes
- Explains the StatefulSet’s YAML role and surrounding storage resources but does not detail identity or update mechanics.
- Examples
- Uses a Migrate for Anthos deployment specification containing a migrated VM image, storage resources, Service, and logging configuration.
- What you can do after
- Evaluate how a Kubernetes deployment specification represents a stateful application and its durable storage requirements.
Related concepts
- Kubernetes controllercontrasts with · A Kubernetes controller is a control-loop component that observes resource state and takes action to move actual state toward desired state.
- persistent volume claimproduces · A PersistentVolumeClaim is a Kubernetes resource through which a workload requests persistent storage with specified capacity, access modes, and other storage characteristics.
- volume claim templatehas part · A volume claim template is a Kubernetes StatefulSet template from which Kubernetes creates a PersistentVolumeClaim for each replicated Pod.
- statefulnessimplements · Statefulness is the property of a system or operation whose behavior or results depend on information retained or changed across interactions or executions.
- pod management policyconfigured by · A pod management policy is a StatefulSet setting that controls whether pods are created sequentially or concurrently during management operations.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



