Longhorn
Cloud-native distributed block storage for Kubernetes. Each node contributes local disk space; data is replicated across nodes for HA. Provides PersistentVolumes, snapshots, and S3 backups with a built-in web UI.
Install
# Helm
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespaceStorageClass
Longhorn installs a default StorageClass. Use it in PVCs:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 10GiKey concepts
| Concept | Description |
|---|---|
| Volume | Block device backed by Longhorn |
| Replica | Copy of volume data on a node’s disk |
| Engine | Per-volume controller that manages replicas |
| Snapshot | Point-in-time copy of a volume |
| Backup | Snapshot exported to S3/NFS |
| StorageClass | longhorn (default), customizable per PVC |
Replication
Default replica count is 3. Set per-volume or globally:
# StorageClass override
parameters:
numberOfReplicas: "2"Backup to S3
Configure in the UI or via Settings → Backup Target:
s3://my-bucket@us-east-1/longhorn
Credentials via a Kubernetes secret named longhorn-s3-secret.
UI
Available at http://<node>:30080 (NodePort) or via the ingress. Shows volume list, node disk usage, snapshots, and backup status.