Storage
Storage classes
| Class | Access mode | Description |
|---|---|---|
hcloud-volumes | ReadWriteOnce | Block storage, the cluster default, supports volume expansion |
nfs-rwx | ReadWriteMany | NFS, for when several pods need to write at the same time |
hcloud-volumes is the default class: a PVC without storageClassName lands there.
On the free tier, name nfs-rwx explicitly
The free tier has no hcloud-volumes, and a PVC without storageClassName is refused there rather than moved to nfs-rwx. A free namespace gets one PVC of at most 1 GiB on nfs-rwx, without autoresize. The examples on this page use hcloud-volumes and need a paid plan.
The RWX class is named nfs-rwx
Not nfs. A PVC with storageClassName: nfs stays Pending.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
storageClassName: hcloud-volumes
resources:
requests:
storage: 10GiBilling
On hcloud-volumes there is a billing minimum of 10 GiB per volume. Smaller PVCs still provision normally but are billed at 10 GiB, so five 2 GiB volumes cost the same as five 10 GiB ones. The floor comes from the block storage itself, not from us.
nfs-rwx has no minimum. It is billed at the size you request, so a 1 GiB shared volume is billed as 1 GiB.
For uploads, media and anything else that does not need a filesystem, object storage is usually cheaper than a volume and is not tied to a single namespace.
Autoresize
Volumes can grow automatically, controlled by three annotations on the PVC. storage_limit is the one that switches it on: without it the volume is never resized, however full it gets.
| Annotation | Default | Meaning |
|---|---|---|
resize.topolvm.io/storage_limit | none, required | Upper bound for expansion |
resize.topolvm.io/threshold | 10% | How little free space triggers an expansion |
resize.topolvm.io/increase | 10% | How much to add per step, as a size or a share of the current capacity |
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
annotations:
resize.topolvm.io/threshold: "20%"
resize.topolvm.io/increase: "10Gi"
resize.topolvm.io/storage_limit: "100Gi"
spec:
accessModes:
- ReadWriteOnce
storageClassName: hcloud-volumes
resources:
requests:
storage: 10Githreshold is free space, not used space
"20%" means: expand once less than 20% is free, that is at 80% full. This is the opposite of what most people assume.
Set it to "80%" and the volume expands at 20% full. It then keeps growing step by step up to storage_limit without ever having been close to full, and you pay for that space the whole time.
Where it works
- On
hcloud-volumes. Autoresize does not work onnfs-rwx, so not on the free tier either. - On CloudNativePG and MariaDB volumes as well.
Volumes only grow
A volume can be expanded but never shrunk. That applies to autoresize and to a manually raised resources.requests.storage alike. To get smaller, create a new PVC, copy the data, and delete the old one.
Platform backups
Your namespace is backed up daily at 03:00 UTC (05:00 in German summer time, 04:00 in winter). The backup covers the Kubernetes objects and the contents of the persistent volumes that a running pod has mounted at that moment. A volume whose workload is scaled to zero, paused or deleted at that time is missing from that backup, so keep workloads whose data should be backed up running then. Daily backups are kept for 30 days. On a paid plan a weekly backup is also kept for 12 weeks and a monthly one for 6 months; the free tier gets the daily backups only. Backups are stored at a second location in the EU.
To restore from one, open a request through the portal and support will carry it out, for the whole namespace or for individual volumes. There is no self-service restore button: restores are handled for you rather than run by you.
This does not replace your own backups
A daily namespace backup is a floor, not a strategy. It will not give you a database consistent to the second, and it will not help with data your application corrupted rather than lost. Keep application-level backups of anything you cannot rebuild, see Databases.
What's next
- Databases, which use these classes
- Billing and quotas for how storage is charged