Storage¶
Persistent storage is provided by Longhorn (CSI provisioner
driver.longhorn.io) — replicated block storage backed by the nodes' local disks.
Disks¶
Each worker has its system disk, which Longhorn also uses for volumes. The data nodes carry a second, dedicated data disk:
- Talos formats it as a user volume and mounts it at
/var/mnt/longhorn-data(talos-clusterpatch-longhorn-data-disk.yaml); the node gets the labelalpstack.coeur.li/data: "true"(patch-labels-data.yaml). - Longhorn registers that path as a second disk on the node with the disk tag
data(platform-argocdapplications/longhorn,dataDisks). A new node is added there only after its user volume is ready, with scheduling off until the disk shows Ready. - The disk itself is not LUKS-encrypted: only the
longhorn-crypto-data*classes place replicas on it, and their replicas already hold ciphertext.
Volumes on the data disks select them by the data disk tag (diskSelector), not by a
node selector.
Node roles¶
Workers carry a role label, set by talos-cluster patches (patch-labels-*.yaml):
| Label | Nodes | Role |
|---|---|---|
alpstack.coeur.li/edge: fw1 or fw2 |
the two edge nodes | targets of the edge firewalls' port forwards (TURN and the MatrixRTC SFU on NodePorts) |
alpstack.coeur.li/data: "true" |
the data nodes | carry the data disk; members of the databases and the S3 store |
- The
edgevalue differs per node (fw1,fw2). Select edge nodes withoperator: Exists, or avoid them withDoesNotExist, never by value. - Members of a replicated database or the S3 store select
alpstack.coeur.li/data: "true"and spread one per node with a required pod anti-affinity onkubernetes.io/hostname. - Other workloads may prefer or avoid the edge nodes with a preferred node affinity; it never blocks scheduling. The edge nodes carry no taint.
StorageClasses¶
| Class | Encrypted | Access | Binding | Replicas | Disks | Backup |
|---|---|---|---|---|---|---|
longhorn (default) |
no | RWO | Immediate | 3 | any | — |
longhorn-static |
no | RWO | Immediate | set on the volume (static PVs) | any | — |
longhorn-local |
no | RWO | WaitForFirstConsumer (strict-local) | 1 | any | — |
longhorn-rwx |
no | RWX | Immediate | 3 | any | — |
longhorn-crypto |
yes | RWO | Immediate | 3 | any | — |
longhorn-crypto-local |
yes | RWO | WaitForFirstConsumer (strict-local) | 1 | any | — |
longhorn-crypto-rwx |
yes | RWX | Immediate | 3 | any | — |
longhorn-crypto-data |
yes | RWO | WaitForFirstConsumer (best-effort locality) | 2 | data |
— |
longhorn-crypto-data-r3 |
yes | RWO or RWX | Immediate | 3 | data |
daily, by the class |
-cryptoclasses encrypt the volume at rest (per-volume key).-rwxclasses are ReadWriteMany (shared), via Longhorn's share-manager.-local/WaitForFirstConsumerbinds the volume on the node where the first consumer pod schedules.longhorn-crypto-datais for applications that replicate their data themselves (databases, the S3 store): two replicas on the data disks, one of them on the pod's node when possible, but the pod is never pinned to it.longhorn-crypto-data-r3is for volumes that have no other copy inside their application: three replicas on the data disks, no data locality (the pod runs anywhere and reaches its volume over the network), and in the daily S3 backup job through the class'srecurringJobSelector. RWO and RWX claims both use it; the PVC sets the access mode.- All classes allow volume expansion — grow the PVC, then the filesystem resizes (a pod restart picks up the new size).
Choosing a class¶
The class carries the policy; an application only picks its class in its own repo.
- Data with no other copy that must survive →
longhorn-crypto-data-r3. It is placed on the data disks and backed up without any per-volume label. - Members of a replicated database or object store →
longhorn-crypto-data; the backup is the application's own (database backups, S3 backup). - Caches and data that is rebuilt on start → the classes on any disk.
Longhorn applies diskSelector and recurringJobSelector only when it creates a volume,
and StorageClass parameters are immutable. A class change therefore needs the class deleted
and recreated (bound volumes are not affected), and an existing volume picks up a new
placement or backup policy only by setting it on the volume.longhorn.io object.
Moving a bound volume to another class without copying data
On a PV, spec.storageClassName can be changed; on a PVC it is immutable. To give an
existing volume a new class: set the PV to Retain and to the new class, recreate the
PVC (for a StatefulSet: delete the StatefulSet with --cascade=orphan first), then clear
uid and resourceVersion from the PV's claimRef so it binds to the new PVC of the
same name. The data stays where it is. Before deleting the PVC, stop every pod that
mounts it, including finished Job pods: a Completed pod still bound to a node keeps
the PVC in Terminating. After an RWO volume moves to another node, check for a leftover
VolumeAttachment of the old node; it blocks the attach on the new one.
Replica posture¶
A StorageClass's replica count decides whether a node or disk loss self-heals or requires a restore:
- Multi-replica classes (the default) keep copies on several nodes — a node or disk loss is repaired by an automatic rebuild, no data lost.
- Single-replica
strict-localclasses keep exactly one copy, pinned to the node the volume was created on. They cannot migrate and cannot rebuild — a lost node or disk means restore from backup, full stop. Their durability rests entirely on the backup tracks.
Databases and other latency-sensitive state are often placed on single-replica strict-local volumes deliberately (local disk, no replication overhead). That is a sound choice only if those volumes are backed up and you accept restore-not-rebuild for them. Know which of your volumes are single-replica before you reboot a node — see Node upgrade & maintenance.
Backups¶
Volume and database backups run on a schedule to external, S3-compatible object storage.
Longhorn volumes on longhorn-crypto-data-r3 are in the daily backup job through their
class; a volume on another class is only backed up if its Longhorn Volume carries the job
label. The backup layout, restore procedures, and disaster-recovery runbooks are maintained in
the private operations documentation.
Longhorn's recurring-job label lives on the Volume, not the PVC
To opt a volume into a Longhorn recurring backup job, the
recurring-job.longhorn.io/<job>: enabled label must be on the volume.longhorn.io
custom resource, not on the PVC. Labelling the PVC is a silent no-op — the volume
is simply never backed up, with no error anywhere. Verify coverage by checking the label
on the Volume CR and confirming backups actually exist for it, not by assuming the PVC
label took effect.
Longhorn upgrades¶
Treat every Longhorn upgrade as a maintenance window — never auto-merged
Any Longhorn version change (patch releases included) rolls the storage-manager DaemonSet
and triggers a single-replica engine-image migration. The migration's reconcile spikes
manager memory regardless of how small the version jump is, and single-replica attached
volumes are skipped by the automatic engine upgrade — they need a manual spec.image
patch per volume afterwards. Land Longhorn bumps by hand, in a window, and watch the roll.
Do not let dependency automation merge them (see Renovate).
Storage on small nodes¶
On memory-constrained worker nodes, a few Longhorn settings are protective, not performance knobs — do not raise them to "go faster":
- Concurrent-rebuild limits (per-node and per-volume) cap how many replica rebuilds run at once. Parallel rebuild storms can OOM-kill the storage manager. Expect rebuilds after a reboot to take time; that is the cost of safety. The real remedy for slowness is more RAM, not more concurrency.
- Give the storage manager a generous memory limit. A container memory limit is not a reservation — only requests count against a node's allocatable memory; the limit is just the burst ceiling. A manager that idles at a couple hundred MiB can carry a multi-GiB limit at zero steady-state cost, and that headroom is exactly what keeps the upgrade cache-sync spike from being cgroup-OOM-killed. Keep the request modest, the limit roomy, and give the manager a high-priority PriorityClass so it is evicted last under node pressure.
See also: Operations · Architecture · Node upgrade & maintenance · Capacity & resource limits.