Kubernetes block storage with Longhorn

Longhorn gives self-managed Kubernetes clusters replicated block volumes on local disks. This page covers the prerequisites, data engine choice, replica placement, backups and the latency it needs.

On this page

When Longhorn is the right Kubernetes block storage for your cluster

Longhorn is a good fit when you run a self-managed Kubernetes cluster on servers you control and need persistent volumes without buying an external storage array. Longhorn is a distributed block storage system that exposes volumes through a CSI driver. It keeps replicas of each volume on the local disks of different nodes, so a single node or disk failure does not take a volume offline. Teams usually choose it when they want replicated block storage built from commodity hardware, when their workloads need ReadWriteOnce volumes, and when no array vendor CSI driver fits their infrastructure. This page covers Longhorn only, not other CSI options such as Ceph or OpenEBS, which have their own pages in this group.

The main trade-off is operating effort. An array CSI driver moves replication, snapshots and disk health into a system your storage team already runs. With Longhorn, the same responsibilities sit inside your cluster: replica rebuilds consume node CPU, memory, disk and network, and a poorly sized network or slow disks show up as volume latency that application teams will blame on the application. Before committing, confirm who will own Longhorn upgrades, node disk monitoring, and restore testing, and confirm that each candidate node has enough free disk and a network path that can carry replica traffic at your expected write volume. Ask any partner to size this from your own node specifications and workload profile, not from a generic template.

The decision also depends on your workloads. Stateful systems that already replicate their own data, such as many databases and Kafka brokers, may be better served by node-local volumes or by their operators, and running them on replicated block storage can double the replication work. Longhorn also suits workloads where a volume must follow a pod to another node within the cluster. Check these requirements against your application vendor's guidance and your recovery objectives before you choose the storage layer, because changing the storage backend for a populated cluster is a migration project in its own right.

Hardware and kernel prerequisites Longhorn needs before install

Longhorn runs as a set of workloads inside your cluster, but it depends on the host beneath each node: the disks it will use for replicas, the kernel modules and packages it loads, and the network clients it needs for attaching volumes and reaching backup targets. Most failed installs trace back to one of these layers, so check them node by node before the Helm chart goes in. Confirm exact versions and the current prerequisite list in the Longhorn documentation for your release, because no version facts were supplied for this page.

Node disk layout for replicas

Longhorn stores replica data on a directory path on each node, which is usually a dedicated disk or partition rather than the operating system volume. Separate disks keep replica growth from filling the root filesystem and causing kubelet disk pressure. Plan one disk per node for replicas, mounted at a stable path, and record which disks are eligible on each node. Ask the Longhorn release notes which filesystem types and default data paths are supported, and confirm that the path survives reboots and is identical across nodes.

Kernel modules and host packages

Longhorn relies on kernel features and host utilities that vary by Linux distribution and image. Your node image must load the modules the chart expects and include the tools the engine uses to manage block devices and filesystems. Standardize this in your node build, such as a golden image or configuration management role, instead of fixing nodes one at a time. Verify the module list and package names against the prerequisite section of the Longhorn documentation for your release, and confirm they persist across reboots.

iSCSI client requirements

Longhorn exposes volumes to pods through the iSCSI protocol on the node, so each worker needs an iSCSI initiator service installed, enabled and running. Many hardened or minimal images omit it, and some distributions ship it disabled by default. Check whether your OS uses an iSCSI daemon that conflicts with another storage agent, and confirm that the initiator name and service configuration are consistent across the fleet. Ask Longhorn support or the docs which initiator versions are validated for your OS.

NFS client for backup targets

Longhorn backups to an NFS target require an NFS client on every node that may mount the backup store during backup or restore. This is separate from the RWX share feature, and it is easy to miss when the backup target is set up after the cluster is running. Confirm the client package for your distribution, test a manual mount from a worker to the NFS export, and check the export permissions for the node network. Object storage targets such as S3 avoid this requirement but need their own network and credential checks.

Environment checks Longhorn runs

Longhorn includes a pre-install environment check that inspects the cluster for missing components before the manager starts. Treat its output as a starting point, not a sign-off, because it does not replace your own review of disks, kernel settings and network paths. Run the check from the Longhorn CLI or documented script, save the output with the change record, and rerun it after every node addition. Failures usually point to missing packages, an unsupported filesystem or a disabled service, so fix the image rather than suppressing the check.

Node sizing and time synchronization

Each node that hosts replicas uses CPU, memory and disk I/O for the Longhorn engine and replica processes, so the sizing for stateful nodes should include storage overhead, not only application requests. Clock drift across nodes complicates replica health and troubleshooting, so confirm that all nodes run a synchronized time service. Ask Longhorn for its documented minimum resources per node and for guidance on how many nodes you need for your replica count, then size the cluster with headroom for a node failure and rebuild traffic.

V1 versus V2 data engine: which Longhorn option fits

This table compares Longhorn's V1 and V2 data engines on kernel and hardware needs, performance targets, maturity and feature coverage. Read each row against your node hardware and release notes, because feature parity and support status change between Longhorn releases and should be confirmed for the version you plan to run.

FactorV1 data engineV2 data engine
Underlying technologyiSCSI-based block path through the Linux kernelSPDK-based user-space engine
Node hardware needsStandard worker nodes with ordinary disks and no special memory setupHugepages must be reserved on each node and NVMe-oriented disks are expected
Kernel and host setupStandard iSCSI and kernel modules available on common Linux distributionsAdditional kernel modules and host configuration are required; confirm the exact list for your OS and Longhorn version
Node coverageBroadest support across mixed or older hardware poolsLimited to nodes that meet the hugepage and disk requirements, so fewer nodes may qualify
Latency and IOPS goalsAdequate for many general workloads; latency depends heavily on disk and networkDesigned for lower latency and higher IOPS on fast NVMe; benchmark your own hardware before committing
Feature coverageMature feature set including snapshots and backups used widely in productionConfirm which snapshot, backup, expansion and replica features are available in your release
Operational maturityLonger track record in production clustersNewer path; check the release notes for known limitations and support status
Typical fitGeneral workloads on mixed nodes, dev and test clusters, and most stateful appsLatency-sensitive databases or logs on dedicated NVMe nodes with planned tuning

How replica count and placement shape failure tolerance

On a single-zone bare metal cluster, every node usually shares the same power feed, top-of-rack switch pair and failure domain. Longhorn can keep several replicas of a volume on different nodes, which protects against a disk or host loss, but it cannot protect against the loss of the whole rack or room. Replica count therefore buys node-level tolerance only, and you should describe the outage you are designing for in those terms before choosing a number.

  • Replica count: Two replicas survive one node or disk loss at the cost of doubling raw capacity. Three replicas tolerate two simultaneous replica losses but triple the raw capacity consumed.
  • Node spread: Set anti-affinity so replicas of one volume never land on the same node. Check this after every node addition, since a small cluster can run out of eligible nodes.
  • Capacity headroom: Plan free space on each node for rebuilds, because a rebuild needs room for a new full replica before the failed one is removed.
  • Shared power and network: Record which nodes share a switch or power distribution unit, since a single fault there can take out several replicas at once.
  • Disk tags: Use node or disk tags to keep replicas on the right media so that a slow disk is never silently chosen for a critical volume.

Ask your infrastructure team to map each node to its power and network domains before you set the default replica count, and confirm the cluster has enough nodes to place the chosen number of replicas on distinct hosts.

How a Longhorn volume is replicated across nodes

The flow starts when a pod requests storage through a PersistentVolumeClaim, which the CSI driver fulfills by attaching a volume to the node where the pod runs. The Longhorn engine on that node serves reads and writes and fans each write out to replicas stored on the disks of other nodes. Snapshots and backups leave the cluster for an external target such as S3 or NFS, so a failed node or cluster does not take the backup copy with it. Check that replicas land on separate nodes and that the backup target is reachable and tested from outside the cluster.

Replicas sit on other nodes' disks, and backups leave the cluster entirely.

Network and disk latency Longhorn needs to perform

Latency, more than raw bandwidth, decides whether Longhorn performs acceptably, because every write to a replicated volume must be acknowledged by each replica before the application sees it as committed. Longhorn keeps a set of replicas for each volume on different nodes, so a single write from a pod fans out over the network to every replica, waits for the slowest acknowledgment and then returns. A slow link or a slow disk on any one replica therefore slows the whole volume, and the effect is strongest for small, synchronous writes such as database commits and Kafka log flushes. Plan the network and disk design around that write path rather than around peak throughput numbers on a datasheet.

Before go-live, measure three things on the actual nodes. First, network throughput and round-trip latency between every pair of storage nodes, under load that resembles production, including the storage network if it is separate from the pod network. Second, fsync latency on the disks Longhorn will use, since replica writes are only as fast as the flush behavior of the underlying device and any RAID or controller cache in front of it. Third, disk contention, meaning how much the same disks are shared with the operating system, container images, logs or other workloads during peaks. Record these results alongside the Longhorn volume settings you intend to use so the baseline can be repeated after upgrades.

Target figures for latency, throughput and fsync time must come from Longhorn's own performance and hardware guidance and from your team's benchmarks on representative hardware, not from generic numbers in this article. Confirm the current recommendations in the Longhorn documentation for your Longhorn version, and confirm the test method and acceptance thresholds with the teams that run the databases and queues that will depend on the volumes. Ask your hardware and network vendors to document the same measurements so that a later performance problem can be traced to a specific link, disk or controller.

Installing Longhorn on a self-managed cluster in order

This sequence takes a self-managed Kubernetes cluster from unchecked nodes to a working Longhorn installation with replicated volumes, tagged disks and a verified failover path. Each step ends with a check so the next step starts from a known state.

  1. Confirm node prerequisites on every worker

    Before installing anything, confirm each worker node meets the requirements in Longhorn's installation documentation: the required kernel modules and packages, iSCSI tooling, a supported filesystem on the data disks, and enough free disk for replicas. The platform team usually runs the environment check script that Longhorn publishes against every node, not a sample. Done is a clean report from every worker, with any failures recorded and fixed on the node image or in the configuration management that builds it, not by hand on one host. Confirm the exact requirements for your Longhorn release before you start, because they change between versions.

  2. Choose the V1 or V2 data engine

    Decide between the V1 data engine, which uses the iSCSI-based path and is the general default, and the V2 data engine, which is built on SPDK and needs hugepages, a supported NVMe-capable disk layout and compatible CPUs. Map each workload to an engine by its latency and IOPS needs, and confirm the V2 requirements against the Longhorn documentation for your version. The output is a written decision per node pool, including which pools will not run V2. Do not enable V2 on nodes that cannot satisfy its hugepage and driver needs, because the setting will not make them work.

  3. Install Longhorn with Helm or a private registry

    The platform team installs Longhorn into its own namespace using the Helm chart or the method your organization standardizes on, pinned to the release you chose in the prerequisite step. For air-gapped clusters, mirror the Longhorn images and the chart into your private registry first, then point the chart values at that registry so no pod pulls from the public internet. Keep the values file in version control. Done is every Longhorn component reporting Running, the manager and driver pods on each node, and the Longhorn UI reachable only from your admin network.

  4. Configure disk and node tags

    Label each node with the tags that describe its role, such as storage tier or failure zone, and register the data disks on each node with matching tags in the Longhorn settings. Tags let you pin volumes to fast disks or keep replicas in separate zones. Reserve the system disk for the operating system and use dedicated data disks for replicas. Done is a node and disk inventory in the Longhorn UI that matches your hardware record, with each disk showing its schedulable state and reserved space.

  5. Set the default StorageClass and replica count

    Create or adjust the StorageClass that Longhorn provides, set the replica count for the default class, and choose the reclaim policy and whether volume expansion is allowed. Mark only one StorageClass as the cluster default, and align the binding mode with how your scheduler places pods across zones. Keep the replica count and tags in the class definition under version control. Done is a single default StorageClass listed by kubectl, and a test PersistentVolumeClaim that binds and reaches the expected replica count in the Longhorn UI.

  6. Verify a test volume survives a node drain

    Create a test workload that writes known data to a volume with replicas on at least two nodes, then cordon and drain one node using your normal maintenance procedure. Confirm the pod reschedules, the volume attaches elsewhere, the data matches your checksum, and Longhorn rebuilds the missing replica once the node returns or a new node joins. This test is illustrative of the check, and you should run it on your own cluster with a data set that represents your workloads. Done is a written result with timings and checksum evidence, kept with the change record.

Snapshots and backups to S3 or NFS targets

Treat Longhorn snapshots and Longhorn backups as two different protections. A snapshot is a point-in-time copy kept inside the cluster on the same replicated volume chain, so it is fast to create and restore but shares the failure domain of the volume: a lost disk pool, a corrupted volume or a deleted cluster takes the snapshots with it. A backup is a copy of a volume's data written to an off-cluster target, either an S3-compatible bucket or an NFS export, and it is the protection that survives losing the cluster. Plan both, and decide which failures each one must cover before you set schedules.

Set up recurring backup jobs as recurring jobs on each volume or StorageClass, with a separate retention count for snapshots and for backups. Keep the backup target on infrastructure outside the cluster's failure domain, and confirm with your storage team how the bucket or export is replicated. Create the backup target credentials as a Kubernetes Secret in the namespace Longhorn expects, restricted by RBAC so that workload teams cannot read them, and rotate them on a schedule. Give the bucket or NFS export write-only access where possible, with lifecycle rules matching your retention policy. Check the exact Secret keys and backup target URL format against the Longhorn documentation for your release, since these details change between versions.

Schedule restore tests before you need a restore. Restore a backup to a separate namespace on a regular cadence, mount it in a test pod, and compare data against the source. Record how long the restore takes, because that figure drives your recovery objectives. Snapshots alone do not give application-consistent recovery, since they capture crash-consistent block state. Pair them with Kubernetes VolumeSnapshot setup, which provides the snapshot controller and VolumeSnapshotClass for application freezing hooks, and with Velero, which backs up Kubernetes objects and volume data together for application-level restores. Confirm with your database or application owners which quiescing steps they need before a snapshot.

Security and operational controls for Longhorn volumes

Longhorn volumes hold application data, so the controls around them matter as much as the replicas themselves. The cards below cover encryption, backup credentials, access to Longhorn objects, replication network isolation and upgrade planning. Each one names a decision to make before the cluster carries production data.

Encryption at rest options

Decide whether volume data must be encrypted on disk and how keys are handled. Longhorn offers volume-level encryption in some releases, which depends on the version you deploy, and the alternative is encrypting the underlying disks or hosts beneath Longhorn. Each choice moves key custody and recovery work to a different team, and performance overhead should be measured on your hardware. Confirm the encryption feature set for your exact Longhorn version before writing it into a design.

Backup target credentials

Snapshots and backups to S3 or NFS need credentials stored as Kubernetes Secrets, and those Secrets are unencrypted in etcd unless encryption at rest is configured. Use a dedicated bucket or export with write rights scoped to the Longhorn backup path, and rotate those keys on a set schedule. Confirm how your Longhorn version reads the backup target secret, since a leaked key gives access to every restored copy of your data.

RBAC on Longhorn resources

Longhorn adds custom resources for volumes, replicas, nodes and settings, and these can change storage behavior for the whole cluster. Restrict create, update and delete on these custom resources and on StorageClasses to the platform team, and grant application teams only PersistentVolumeClaim rights in their namespaces. Review who can edit the default StorageClass, since a permissive default affects every workload that omits a class.

Replication traffic isolation

Replica synchronization moves full volume data between nodes, so it competes with application traffic on shared links. Plan a dedicated storage network where hardware allows, and use NetworkPolicy to limit which pods reach the Longhorn manager and instance manager ports. Confirm the ports and the network settings your Longhorn version expects before applying policies, because a blocked replica path shows up as degraded volumes rather than a clear error.

Upgrade planning for volumes

Longhorn upgrades touch the manager, engine and instance components that serve live volumes, so they need their own change window and rollback plan. Check the Longhorn upgrade path and the Kubernetes version support for the release you target, and confirm that the Kubernetes minor version you run is in the supported set. Take verified backups and confirm volumes are healthy before each step, and treat Kubernetes control plane upgrades and Longhorn upgrades as separate changes.

Kubernetes skew policy

Checks before go-live

Before production data lands on Longhorn, run a short checklist: confirm encryption design, test one backup and one restore to a separate namespace, verify replica failover after a node is drained, and review RBAC bindings. Record the results with the configuration in version control so auditors and operators can see the state that was tested. Repeat the checklist after each upgrade, because settings and defaults can change between releases.

Questions buyers ask before running Longhorn in production

What does a Longhorn implementation cost and what drives the price?

The cost is mostly the labor to design and build the storage layer, plus any hardware or cloud capacity you add for it. Longhorn itself is open source, so there is no license fee to pay for the software. The main cost drivers are the number of nodes and disks, how many replicas you need per volume, whether you need backups to S3 or NFS, how many workloads depend on it, and how much testing you want before production. Ask any partner for a quote built from a written scope that lists nodes, disks, network paths, backup targets, workloads to validate and the acceptance tests. Separate one-time work (design, install, test) from recurring work (upgrades, monitoring, restore drills, capacity growth).

How long does a Longhorn rollout take, and what sets the duration?

Duration depends on the size and readiness of the environment more than on Longhorn itself. The schedule usually moves with the state of the nodes (kernel modules, packages, disk layout), how many storage classes and workloads must be validated, whether the network and disk latency meet what Longhorn needs, how backup targets are provisioned and tested, and how quickly your change process approves each step. Ask for a timeline tied to milestones: prerequisite check, pilot cluster, replica and failure tests, backup and restore drill, and production cutover. Any duration should come from a written plan for your environment rather than a generic estimate.

What does our team need to provide for the work?

You will need to supply access and decisions that only your organization can make. Typical inputs are node inventory with CPU, memory and disk details, network topology between nodes, the Kubernetes version and distribution in use, the target backup location (S3-compatible storage or NFS), identity and RBAC rules for who may create volumes, and maintenance windows. Your team also needs to name owners for storage alerts, capacity planning and restore approvals. Expect a few hours of workshop time at the start and reviews at each milestone. Confirm these inputs in the first scoping call so the quote reflects your real environment.

Can our internal platform team build and run Longhorn without outside help?

A capable platform team can run Longhorn alone if it already operates Kubernetes well and has time to learn storage behavior. The hard parts are not the installation but the design choices: replica count, placement across failure domains, disk and network sizing, the choice between the V1 and V2 data engines, and tested restores from backups. Teams that have not run replicated storage before often underestimate the restore drills and the troubleshooting of degraded volumes. An outside partner can shorten the learning curve and provide an independent review. Decide based on who will be on call and whether they have rehearsed a failed node recovery.

How does Longhorn compare with array or Ceph storage in operating effort?

Longhorn usually asks less specialized operating effort than Ceph because it runs as a set of components inside the cluster and uses the local disks of worker nodes. Ceph gives broader capabilities, including object and file storage, but it needs more planning for placement, monitoring and upgrades. Array-based CSI drivers move much of the storage work to the hardware vendor, but they add vendor contracts and different failure modes. The effort depends on your scale, your skills and which storage types you need. Compare the three on the same workload list, including snapshot support, backup handling, upgrade process and who answers when a volume goes read-only.

What network and disk latency does Longhorn need?

Longhorn replicates every write across nodes, so network latency and disk latency both affect application performance. Replicas move data over the cluster network, which should be dedicated or at least sized for replication traffic. Slow disks or shared network links show up as higher write latency and slow rebuilds after a node fails. Measure disk latency and network throughput on the actual hardware before you pick a design, and confirm the requirements in the current Longhorn documentation for your version. Latency-sensitive databases may need the V2 data engine or a different storage design, which should be tested with your own workload.

Where should Longhorn backups go, and how do we prove they restore?

Longhorn can write volume backups to an S3-compatible object store or to an NFS share, and the choice affects cost, durability and recovery speed. Object storage is often easier to replicate off site, while NFS may suit an existing storage estate. Keep the backup target outside the failure domain of the cluster, and set retention to match your recovery objectives. A backup is only proven when you restore it. Schedule restore drills into a separate namespace, check data integrity in the application, and record the time taken. Ask any partner to include these drills in the acceptance criteria.

How DeployOpen scopes and delivers Longhorn storage

DeployOpen plans, builds and hands over Longhorn block storage inside your own clusters and infrastructure. Each engagement starts with a written scope covering node prerequisites, replica placement, backup targets and the operating model your team will run.

How we scope

  • Inventory node disks, kernel modules, network links and the workloads that will claim Longhorn volumes.
  • Decide the data engine per workload and record why V1 or V2 fits each StorageClass tier.
  • Agree the backup target, retention and restore expectations in writing before any build starts.
  • Define the written scope, deliverables and timeline as a fixed-scope agreement, with a quote following from that scope.

How we build

  • Prepare nodes and verify prerequisites such as iSCSI tooling, kernel settings and disk layout on your hardware.
  • Configure StorageClasses, replica counts, replica placement and node or disk tags for your failure domains.
  • Test node drain, replica rebuild and volume expansion in a staging environment before production rollout.
  • Set up snapshots and backups to your S3-compatible or NFS target, then run a timed restore test.

How we hand over

  • Document the final architecture, StorageClass catalog, network and disk latency requirements and sizing assumptions.
  • Provide runbooks for volume recovery, replica rebuilds, backup restores and node maintenance procedures.
  • Walk your platform and operations teams through monitoring signals, alerts and the upgrade order for Longhorn.
  • Deliver configuration as code so your team can review and reproduce the storage setup later.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Plan Longhorn version upgrades alongside your Kubernetes upgrade cycle and test them before production.
  • Retest backup and restore paths on a schedule your team agrees, and after significant cluster changes.
  • Confirm with your team which support hours, response paths and escalation contacts the retainer will include.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.