Longhorn Add-On

Longhorn is a CNCF Sandbox Project originally developed by Rancher labs as a “lightweight, reliable and easy-to-use distributed block storage system for Kubernetes”. Longhorn uses a microservice-based architecture to create a pod for every Custom Resource in the Longhorn ecosystem: Volumes, Replicas, a control plane, a data plane, etc.

Longhorn uses the /var/lib/longhorn directory for storage on all nodes. This directory should have enough space to hold a complete copy of every PersistentVolumeClaim that will be in the cluster. For production installs, an SSD should be mounted at /var/lib/longhorn.

Advanced Install Options

spec:
  longhorn:
    version: latest
    uiBindPort: 30880
    uiReplicaCount: 0

Flag Usage
version The version of Longhorn to be installed.
uiBindPort The port number used for the NodePort service exposing the Longhorn UI. Default is 30880.
uiReplicaCount The number of replicas created for the Longhorn UI Deployment. Default is 0.

Longhorn UI

The Longhorn UI deployment does not run by default because it is an unauthenticated application. It can be enabled by setting the replica count to 1 in the longhorn spec. This will make the UI available on port 30880 on all nodes in the cluster.

spec:
  longhorn:
    version: latest
    uiReplicaCount: 1

To enable the UI without re-running the installer, use the command kubectl -n longhorn-system scale deployment longhorn-ui --replicas=1.

Migration from Rook

If Rook was previously installed but is no longer specified in the kURL spec and Longhorn 1.1.2+ is specified instead, Longhorn will migrate data from Rook PVCs to Longhorn. This will involve stopping all pods mounting Rook PVCs while the migration takes place.

If MinIO is also specified in the new kURL spec and completes its migration process successfully, Rook will be removed to free up resources.