All languages

Kubernetes

You're viewing a free preview. Sign in free to read every script.

Why this exists A Deployment's Pods are interchangeable: any one of them can be killed and replaced by an identical stranger, which is exactly right for a stateless API. A database is the opposite: which specific copy…

StatefulSet for a Database: Stable Storage and Identity

A real Postgres StatefulSet with a headless Service, proven against a live cluster — data survives deleting and recreating the Pod, each replica gets its own independent PersistentVolumeClaim (not a shared or copied one), Pods get stable per-Pod DNS names, and scaling down leaves the departed replica's PVC bound rather than deleting it, a real trap worth knowing before it costs you.

Sign in free to read this script, along with the rest of the library.

Sign in free