Prerequisites
- A Kubernetes cluster with at least 3 nodes
- kubectl CLI installed on your local workstation
- Helm installed (for installing Longhorn)
Step 1: Prepare your cluster
Check available disks
Run
lsblk on each node to find available disks and partitions to dedicate to Longhorn.Step 2: Install Longhorn
Longhorn can be installed on a K8s cluster in several ways. In this guide, we’ll go with Helm.Step 3: Access the Longhorn UI
Check services
Run this command to check if the Longhorn services are up:The output should be something like this:

Step 4: Configure storage
Check nodes
In the Longhorn UI, navigate to Node and check if your disks are detected automatically.

Step 5: Create a StorageClass
Step 6: Create a PersistentVolumeClaim (PVC)
Step 7: Use the PVC in a Pod
Troubleshooting
- If Longhorn nodes show as unschedulable, check disk space and ensure no taints are blocking pods.
- For performance tuning, you can adjust the number of replicas for each volume in the Longhorn UI under Settings > Default Settings.
- If using firewalls, ensure ports 9500-9600 are open for communication between Longhorn components.
