DELAPARRA
Index
Color
NL
Category: Kubernetes

StatefulSet

Explained by Updated

What is StatefulSet?

StatefulSet: Like a Deployment but for stateful apps that need stable network identities and stable per-Pod storage — databases, queues, clustered services. A StatefulSet runs applications that need a stable identity and their own storage in Kubernetes, such as databases, message brokers and clustered services. Unlike a Deployment, each pod gets a fixed name, like db-0 and db-1, a stable network address and its own persistent volume that follows it when the pod is recreated. Pods are started and stopped in order.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about StatefulSet

What should you keep in mind with StatefulSet?

Running databases in Kubernetes is possible but takes care: backups, upgrades, failover and storage performance all become your responsibility. For many teams, a managed database from the cloud provider is simpler and safer, with the application in Kubernetes connecting to it. If you do run stateful services yourself, operators such as CloudNativePG for PostgreSQL automate much of the hard work.

What does an example of StatefulSet look like?

apiVersion: apps/v1 kind: StatefulSet metadata: name: db spec: serviceName: db replicas: 3 selector: matchLabels: { app: db } template: metadata: labels: { app: db } spec: containers: - name: db image: postgres:16

At a glance

CategoryKubernetes
Explained by
Updated

More Kubernetes terms

All terms starting with S

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.