Step 01 of 06
Learn the concept
The moment Beacon writes a database, stateless comfort ends. Kubernetes can keep a file alive after a Pod dies, but it will not make SQLite a distributed database out of kindness.
The ideas this is made of
Pod filesystems are ephemeral
Files written inside a container's writable layer disappear when the Pod is replaced. That is fine for caches and fatal for SQLite. A restart of the same container may preserve some local state briefly, but a reschedule or rollout does not. Durable data must live on a volume outside the container filesystem and be mounted into the Pod.
PVC is the app's storage request
A PersistentVolumeClaim says what the workload needs: size, access mode and optionally a StorageClass. A PersistentVolume is the actual storage the cluster binds to that claim. Dynamic provisioning lets a StorageClass create the PV automatically. In kind, the default provisioner uses local storage inside the node container, which is enough for learning, not for production durability.
SQLite makes rolling Deployment semantics dangerous
A Deployment with two replicas and one writable SQLite database is a trap. During rollout, old and new Pods can overlap. Two processes may try to write the same file unless the volume and app are carefully designed for it. SQLite is excellent for one writer in one place; it is not a shared multi-writer cluster database.
StatefulSet gives stable identity
A StatefulSet creates Pods with stable names like beacon-0 and stable volume claims derived from templates. It rolls them in order and keeps identity tied to storage. For Beacon's local SQLite version, one replica in a StatefulSet matches the database's shape: one service instance, one persistent database file, one clear owner.
one notebook
one person writes safely
two people write at once
pages tear, order liesSQLite is the notebook. It is robust, simple and honest about its shape. Kubernetes has to respect that shape instead of pretending every workload wants ten replicas.
PV, PVC, StorageClass and StatefulSet
| Term | Question answered | Beacon use |
|---|---|---|
StorageClass | How is storage made? | kind default |
PersistentVolume | What storage exists? | Provisioned disk |
PVC | What does app request? | 1Gi, RWO |
Access mode | Who may mount it? | ReadWriteOnce |
StatefulSet | Who owns stable storage? |
|
What these are called on the job
PersistentVolume — A cluster storage resource, provisioned manually or dynamically.
PersistentVolumeClaim — A namespaced request for storage made by a workload.
StorageClass — The rule set for dynamically creating volumes.
StatefulSet — A controller for Pods with stable names, ordered rollout and stable volume claims.
