Happy Dussehra! May good always win. Merry Christmas! Warm wishes from Vizag. Happy New Year! Here’s to a great year ahead.

DevOps · CNCF daily

Longhorn: Distributed Block Storage for Kubernetes, with Velero for Backup

CNCF Incubating. Turns the local disks of Kubernetes nodes into replicated block volumes with snapshots and S3 backups, and pairs with Velero for cluster-level backup and restore.

9 min read

CNCF Incubating

  • Longhorn
  • Velero
  • Kubernetes
  • CSI
  • S3
CNCF project page

Longhorn is a distributed block storage system for Kubernetes. It pools the local disks of worker nodes and presents them as replicated persistent volumes through the Container Storage Interface (CSI), with incremental snapshots, scheduled backups to S3 or NFS, and a web dashboard. It solves a common on-premises and edge problem: stateful workloads need volumes that survive a node failure, but a SAN or a full Ceph cluster is more infrastructure than a small platform team wants to run. Longhorn originated at Rancher Labs (now part of SUSE) and was accepted into the CNCF as a sandbox project on 11 October 2019; it moved to incubating on 4 November 2021. This brief also covers Velero, the Kubernetes backup and restore tool that complements Longhorn. Velero is a Kubernetes-native backup, restore and migration tool that Broadcom contributed to the CNCF, where it was accepted at the sandbox level on 11 March 2026.

CNCF daily · Sprint 2, day 5 · Cloud Native Storage

At a glance

Category Runtime › Cloud Native Storage
CNCF status Longhorn: Incubating. Accepted October 11, 2019; moved to Incubating November 4, 2021
Companion project Velero: Sandbox. Accepted March 11, 2026 (Runtime › Cloud Native Storage)
Written in Go
License Apache 2.0 (both projects)
Data engines V1 (iSCSI based, default) and V2 (SPDK based)
Backup targets S3-compatible object storage or NFSv4 (Longhorn); S3, GCS, Azure Blob and others through plugins (Velero)

Architecture

Longhorn and Velero architecture: an application pod mounts a PVC through the Longhorn CSI driver; a per-volume engine writes synchronously to three replicas on different nodes and sends incremental backups to an S3 or NFS backup target; longhorn-manager schedules and heals; Velero reads objects from the Kubernetes API, requests volume snapshots through the CSI driver and writes cluster state to object storage.

Blue is the application, purple Longhorn, teal storage, amber Velero and slate Kubernetes. Velero is a separate project and does not use Longhorn’s own backup path: it saves cluster objects and asks the CSI driver for volume snapshots. The instance manager and share manager are not drawn. Open the zoomable diagram, or download it as SVG or PNG.

Component Responsibility
Longhorn CSI driver Attaches and mounts the volume into the pod.
Engine A lightweight controller, one per volume, that serves the block device to the pod and writes to every replica synchronously.
Replicas Copies of the volume stored as sparse files on node disks, normally three on different nodes.
longhorn-manager DaemonSet that exposes the API, schedules replicas onto nodes and disks, and rebuilds failed replicas.
Backup target An S3-compatible or NFS location for incremental, deduplicated backups, enabling cross-cluster restore and disaster-recovery volumes.
Velero Server and node agent that copy Kubernetes objects to object storage and, for volume data, trigger CSI snapshots or move data with the node agent.
Object storage Holds Velero’s backups of cluster state.

Not drawn: the instance manager, which runs engine and replica processes on each node so a manager upgrade does not interrupt I/O, and the share manager, which exports a volume over NFS for ReadWriteMany access.

Design principle. Longhorn runs a separate small storage controller for every volume instead of one large shared storage cluster. A fault or upgrade therefore affects one volume at a time, and the design is simple enough to understand and repair. Velero follows the same Kubernetes-native idea: backups and restores are custom resources, so they can be scheduled, audited and managed through GitOps.

A write, a replica set and a backup

Longhorn and Velero flow in ten steps: the pod mounts a PVC, CSI attaches the engine, the engine writes to three replicas, longhorn-manager schedules and heals, the engine sends incremental backups to the backup target, and Velero reads cluster objects, requests a snapshot through CSI and writes cluster state to object storage.

  1. Mount. The pod mounts its PVC through the Longhorn CSI driver.
  2. Attach. The driver attaches the volume’s engine to the node as a block device.
  3. Write to replica A. The engine writes each block to the first replica.
  4. Write to replica B. It writes to the second replica.
  5. Write to replica C. It writes to the third, and acknowledges the write when all healthy replicas have it.
  6. Manage. longhorn-manager schedules replicas and rebuilds any that fail.
  7. Back up. The engine sends incremental backups to the backup target.
  8. Read objects. Velero reads the Kubernetes objects to protect from the API server.
  9. Snapshot. It requests a volume snapshot through the CSI driver.
  10. Write backup. It writes the backup of cluster state to object storage.

Steps 1 to 5 run for every write; steps 6 and 7 run continuously or on schedule; steps 8 to 10 run when a Velero backup is taken.

Open the zoomable flow diagram, or download it as SVG or PNG.

Production reference design

A typical layout is a three-node (or larger) cluster on bare metal, on-premises virtualisation or EKS and similar, with a dedicated disk on each node.

  1. Prepare the nodes. Longhorn needs open-iscsi and, for ReadWriteMany, an NFS client. Run the project’s preflight check before installing:
    sudo apt install -y open-iscsi nfs-common && sudo systemctl enable --now iscsid
    longhornctl check preflight
  2. Install Longhorn with Helm, pinning the chart version:
    helm repo add longhorn https://charts.longhorn.io && helm repo update
    helm install longhorn longhorn/longhorn -n longhorn-system --create-namespace --version 1.12.1
  3. Define a StorageClass with the replica count and recovery behaviour the workload needs:
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata: { name: longhorn-db }
    provisioner: driver.longhorn.io
    allowVolumeExpansion: true
    reclaimPolicy: Retain
    parameters:
      numberOfReplicas: "3"
      dataLocality: best-effort
      staleReplicaTimeout: "30"
  4. Set a backup target and recurring jobs. Point Longhorn at an S3 bucket (through a Secret with the credentials) and schedule snapshots and backups per volume group.
  5. Add Velero for everything around the volumes. Install it with a bucket and a Longhorn-aware snapshot class, so a backup captures both the manifests and the volume data:
    apiVersion: snapshot.storage.k8s.io/v1
    kind: VolumeSnapshotClass
    metadata:
      name: longhorn-backup
      labels: { velero.io/csi-volumesnapshot-class: "true" }
    driver: driver.longhorn.io
    deletionPolicy: Delete
    parameters: { type: bak }
    velero schedule create daily --schedule "0 2 * * *" --ttl 720h --snapshot-move-data

Typical uses are PostgreSQL, MySQL and message brokers on bare-metal clusters, persistent volumes for CI systems and internal tools on edge or private-cloud Kubernetes, and cluster migration or disaster recovery with Velero restoring into a different cluster.

Operational considerations

  • Replication is not a backup. Three replicas protect against a node or disk failure, not against deletion or corruption, which replicate instantly. Always configure the backup target and test a restore, including restoring into a second cluster.
  • Performance depends on the network and disks. Synchronous replication adds latency and consumes bandwidth during rebuilds. Use dedicated SSD or NVMe disks and a fast node network, and use dataLocality to keep one replica next to the pod. The V2 engine targets higher IOPS but needs huge pages and specific kernel modules, so test it before relying on it for production data.
  • Capacity planning. Three replicas triple the raw space used. Longhorn keeps a minimum percentage of each disk free by default, so size disks with that margin and watch the over-provisioning setting.
  • Upgrades and node maintenance. Upgrade one minor version at a time, check volume health first, and drain nodes one by one so replicas can rebuild between steps. Set a sensible node drain policy.
  • Velero scope. Velero backs up API objects, not etcd itself. Keep schedules, retention (--ttl) and the bucket under access control, and exercise a restore regularly, since restore order, CRDs and external dependencies are the usual failure points.

Adoption

  • The Longhorn project’s ADOPTERS.md lists end users including Nemlig, which uses it as persistent storage in its internal Kubernetes platform, NAVER, Walkbase, JTEKT, which runs it in an on-premises developer platform, and Child Rescue Coalition.
  • Longhorn is also packaged commercially in the SUSE Rancher ecosystem and is a common default storage choice in lightweight Kubernetes distributions.
  • Velero’s CNCF page lists a case study from the Infosys client programme, in which Velero is one of several tools used on a Kubernetes platform. Broadcom, Red Hat and Microsoft are named as maintainers, but the project’s CNCF history is short and few organisations are named publicly.

Alternatives

Solution Model Best suited to
Rook (Ceph) (CNCF Graduated) Operator-managed Ceph for block, file and object Larger clusters needing all three storage types and very high scale
OpenEBS (CNCF Sandbox) Several engines, including local and replicated volumes Teams wanting a choice between local PV simplicity and replication
Piraeus / LINSTOR (CNCF Sandbox) DRBD-based replicated block storage Low-latency replicated volumes on Linux hosts
Cloud CSI drivers (EBS, Persistent Disk, Azure Disk) Provider-managed block devices Clusters in a single public cloud that do not need portability
Kasten K10, Kanister, K8up Backup tools, some CNCF Sandbox Application-aware backup, or an alternative to Velero

Strengths and limitations

Strengths Limitations
Simple install and a clear dashboard; no separate storage cluster to run Replicated block only; object and shared file need other tools (RWX is NFS-based)
Built-in snapshots, S3 and NFS backups and disaster-recovery volumes Synchronous replication adds latency; not a match for local NVMe speed
Per-volume engines limit the blast radius of failures and upgrades Three replicas mean three times the raw capacity
Velero adds portable, GitOps-friendly cluster backup and migration Velero is a young CNCF project; restore testing is still the operator’s job
Apache 2.0, active development and a clear roadmap The V2 engine needs extra node setup and careful testing

Recommendation

Trial. Longhorn is a sound default for stateful workloads on small and medium on-premises, edge or private-cloud clusters, where simplicity matters more than extreme scale. Adopt it for non-critical and moderately demanding volumes first, keep an off-cluster backup target from day one, and pair it with Velero for cluster-level recovery. For very large or latency-critical systems, evaluate Rook or local storage with application-level replication.

References: CNCF project page: Longhorn · CNCF project page: Velero · Longhorn documentation · Longhorn ADOPTERS · Velero documentation · Velero 1.17 release notes · InfoQ: Broadcom donates Velero to the CNCF

Spotted something wrong or out of date?Suggest a correction. I review every suggestion before changing the page.

EmailRSS