You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

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:

  • Enterprise-grade distributed block storage with no single point of failure;
  • Incremental snapshot of block storage;
  • Backup to secondary storage (NFS or S3-compatible object storage) built on efficient change block detection;
  • Recurring snapshots and backups;
  • Automated, non-disruptive upgrades. You can upgrade the entire LH software stack without disrupting running storage volumes;
  • An intuitive GUI dashboard.

Installation

LH can be installed on a Kubernetes cluster in several ways: Rancher catalog app, kubectl or Helm. In this guide we will focus on the installation via Helm chart, which must of course be installed. However, for further details, please refer to the official guide.

Requirements

Each node in the Kubernetes cluster where LH is installed must fulfill the following requirements:

  1. A container runtime compatible with Kubernetes (Docker v1.13+, containerd v1.3.7+, etc.).
  2. Kubernetes v1.16+ (recommend Kubernetes v1.17+).
  3. open-iscsi is installed, and the iscsid daemon is running on all the nodes. This is necessary, since LH relies on iscsiadm on the host to provide persistent volumes to Kubernetes.

    Install iscsi
    # If not present, launch the command
    $ sudo yum install iscsi-initiator-utils -y
  4. RWX support requires that each node has a NFSv4 client installed.

    Install nfs-utils
    # If not present, launch the command
    $ sudo yum install nfs-utils -y
  5. The host filesystem supports the file extents feature to store the data. Currently we support ext4 and XFS.

    Filesystem type
    # 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% /
  6. curl, findmnt, grep, awk, blkid, lsblk must be installed.
  7. Mount propagation must be enabled.

    Mount propagation
    # 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

Installation with Helm

Add the LH Helm repository and fetch the latest charts from the repository

Add repository
$ helm repo add longhorn https://charts.longhorn.io
$ helm repo update

To install LH with Helm 3, use these commands

Install LH
kubectl create namespace longhorn-system
helm install longhorn longhorn/longhorn --namespace longhorn-system

The initial settings for Longhorn can be customized using Helm options or by editing the deployment configuration file. To obtain a copy of the values.yaml file

Customize LH
$ helm show values longhorn/longhorn > values.yaml
# Modify the default settings in the YAML file and then add flag "--values values.yaml" in the install command
$ helm install longhorn longhorn/longhorn --namespace longhorn-system --values values.yaml

To confirm that the deployment succeeded, run

Verify installation
$ kubectl -n longhorn-system get pod
NAME                                        READY   STATUS              RESTARTS   AGE
compatible-csi-attacher-d9fb48bcf-2rzmb     1/1     Running             0          8m58s
csi-attacher-78bf9b9898-grn2c               1/1     Running             0          32s
csi-attacher-78bf9b9898-lfzvq               1/1     Running             0          8m59s
csi-attacher-78bf9b9898-r64sv               1/1     Running             0          33s
csi-provisioner-8599d5bf97-c8r79            1/1     Running             0          33s
csi-provisioner-8599d5bf97-fc5pz            1/1     Running             0          33s
csi-provisioner-8599d5bf97-p9psl            1/1     Running             0          8m59s
csi-resizer-586665f745-b7p6h                1/1     Running             0          8m59s
csi-resizer-586665f745-kgdxs                1/1     Running             0          33s
csi-resizer-586665f745-vsvvq                1/1     Running             0          33s
engine-image-ei-e10d6bf5-pv2s6              1/1     Running             0          9m30s
instance-manager-e-379373af                 1/1     Running             0          8m41s
instance-manager-r-101f13ba                 1/1     Running             0          8m40s
longhorn-csi-plugin-7v2dc                   4/4     Running             0          8m59s
longhorn-driver-deployer-775897bdf6-k4sfd   1/1     Running             0          10m
longhorn-manager-79xgj                      1/1     Running             0          9m50s
longhorn-ui-9fbb5445-httqf                  0/1     Running             0          33s
  • No labels