Longhorn
1 min read

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

sh
# Helm
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace

StorageClass

Longhorn installs a default StorageClass. Use it in PVCs:

yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 10Gi

Key concepts

ConceptDescription
VolumeBlock device backed by Longhorn
ReplicaCopy of volume data on a node's disk
EnginePer-volume controller that manages replicas
SnapshotPoint-in-time copy of a volume
BackupSnapshot exported to S3/NFS
StorageClasslonghorn (default), customizable per PVC

Replication

Default replica count is 3. Set per-volume or globally:

yaml
# 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.