SkillsApr 11, 2026·3 min read

Longhorn — Cloud Native Distributed Block Storage for Kubernetes

Longhorn is a lightweight, reliable distributed block storage system for Kubernetes. Persistent volumes with replication, snapshots, backups, and disaster recovery.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Stage only
Trust
Trust: Established
Entrypoint
step-1.md
Safe staging command
npx -y tokrepo@latest install ca7e61b6-353d-11f1-9bc6-00163e2b0d79 --target codex

Stages files first; activation requires review of the staged README and plan.

TL;DR
Lightweight distributed block storage for Kubernetes with replication, snapshots, and backups.
§01

What it is

Longhorn is a lightweight, reliable distributed block storage system for Kubernetes. It provides persistent volumes with built-in replication, snapshots, scheduled backups to S3-compatible storage, and disaster recovery. Each volume is an independent microservice managed by its own controller, which simplifies troubleshooting and prevents a single storage failure from affecting the entire cluster.

Longhorn targets Kubernetes administrators who need persistent storage without deploying heavyweight solutions like Ceph or GlusterFS. It is a CNCF incubating project maintained by SUSE/Rancher.

§02

How it saves time or tokens

Setting up distributed storage on Kubernetes traditionally requires deep expertise in storage systems. Longhorn installs with a single kubectl apply and manages itself. Automatic replication ensures data survives node failures. Scheduled backups to S3 eliminate manual backup scripts. The built-in UI provides volume health, replica status, and snapshot management without additional tooling.

§03

How to use

  1. Install Longhorn on your Kubernetes cluster:
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.0/deploy/longhorn.yaml
  1. Wait for installation to complete:
kubectl -n longhorn-system get pods -w
  1. Create a PersistentVolumeClaim using the Longhorn storage class:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-data
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: longhorn
  resources:
    requests:
      storage: 10Gi
§04

Example

Configuring automated S3 backups:

# Create a backup target secret
apiVersion: v1
kind: Secret
metadata:
  name: s3-backup-target
  namespace: longhorn-system
stringData:
  AWS_ACCESS_KEY_ID: 'your-key'
  AWS_SECRET_ACCESS_KEY: 'your-secret'
  AWS_ENDPOINTS: 'https://s3.amazonaws.com'

Then set the backup target in Longhorn Settings to s3://my-backup-bucket@us-east-1/ and schedule recurring backups per volume.

§05

Related on TokRepo

§06

Common pitfalls

  • Longhorn requires open-iscsi installed on all worker nodes; missing this dependency causes volume mount failures
  • Three replicas (the default) require at least three nodes with available disk space; adjust the replica count for smaller clusters
  • Snapshots consume disk space proportional to data changes; configure snapshot cleanup policies to prevent disk exhaustion

Frequently Asked Questions

How does Longhorn compare to Ceph?+

Longhorn is simpler to deploy and manage but has a smaller feature set. Ceph supports block, file, and object storage with advanced features like erasure coding. Longhorn focuses on block storage with a lightweight architecture. Choose Longhorn for simplicity and Ceph for scale and versatility.

Does Longhorn support ReadWriteMany volumes?+

Longhorn primarily supports ReadWriteOnce (RWO) volumes. ReadWriteMany (RWX) is supported through an NFS-based mechanism, but performance may be lower than dedicated NFS or CephFS solutions.

How does replication work?+

Each Longhorn volume maintains multiple replicas (default: 3) on different nodes. Writes are synchronously replicated to all healthy replicas. If a node fails, the remaining replicas continue serving the volume, and Longhorn automatically rebuilds the missing replica on another node.

Can I back up volumes to S3?+

Yes. Longhorn supports incremental backups to any S3-compatible storage (AWS S3, MinIO, Backblaze B2). You can schedule recurring backups and restore them to create new volumes, even on a different cluster for disaster recovery.

Is Longhorn production-ready?+

Longhorn is a CNCF incubating project used in production by organizations running stateful workloads on Kubernetes. SUSE/Rancher provides commercial support through Rancher Prime.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets