Longhorn is a lightweight, reliable, and powerful distributed block storage system for Kubernetes. Longhorn (henceforth LH) implements distributed block storage using containers and microservices. LH creates a dedicated storage controller for each block device volume and synchronously replicates the volume across multiple replicas stored on multiple nodes. The storage controller and replicas are themselves orchestrated using Kubernetes. The main features are:
LH can be installed on a Kubernetes cluster in several ways: Rancher catalog app, kubectl, Helm. In this guide we will focus on the installation via Helm chart. However, for further details, please refer to the official guide.
Each node in the Kubernetes cluster where Longhorn is installed must fulfill the following requirements:
open-iscsi is installed, and the iscsid daemon is running on all the nodes. This is necessary, since Longhorn relies on iscsiadm on the host to provide persistent volumes to Kubernetes.
# If not present, launch the command $ sudo yum install iscsi-initiator-utils -y |
RWX support requires that each node has a NFSv4 client installed.
# If not present, launch the command $ sudo yum install nfs-utils -y |
The host filesystem supports the file extents feature to store the data. Currently we support ext4 and XFS.
# Check that the database type is "xfs" or "ext4" $ df -T $ df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 xfs 80G 5.0G 76G 7% / |
Mount propagation must be enabled.
# Insert the following lines into the file "/etc/systemd/system/docker.service.d/mount_propagation_flags.conf" [Service] MountFlags=shared # Then restart the service $ sudo systemctl daemon-reload $ sudo systemctl restart docker.service |