Post

Longhorn - Powerful distributed block storage for Kubernetes

What is Longhorn?

Longhorn is a lightweight, reliable and easy-to-use distributed block storage system for Kubernetes.

Longhorn is free, open source software. Originally developed by Rancher Labs, it is now being developed as a incubating project of the Cloud Native Computing Foundation.

Prerequisites

  • A container runtime compatible with Kubernetes (Docker v1.13+, containerd v1.3.7+, etc.)
  • Kubernetes >= v1.21
  • open-iscsi is installed
  • RWX support requires that each node has a NFSv4 client installed.
  • filesystem supports:
    • ext4
    • XFS
  • bash, curl, findmnt, grep, awk, blkid, lsblk must be installed.

Installing Longhorn with Helm

  1. Add the Longhorn Helm repository:
    1
    
      helm repo add longhorn https://charts.longhorn.io
    
  2. Fetch the latest charts from the repository:
    1
    
      helm repo update
    
  3. Install Longhorn in the longhorn-system namespace:
    1
    
      helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.4.1
    
  4. To confirm that the deployment succeeded, run:
    1
    
      kubectl -n longhorn-system get pod
    

    The result should look like the following:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
      NAME                                           READY   STATUS    RESTARTS   AGE
      longhorn-ui-b7c844b49-w25g5                    1/1     Running   0          2m41s
      longhorn-conversion-webhook-5dc58756b6-9d5w7   1/1     Running   0          2m41s
      longhorn-conversion-webhook-5dc58756b6-jp5fw   1/1     Running   0          2m41s
      longhorn-admission-webhook-8b7f74576-rbvft     1/1     Running   0          2m41s
      longhorn-admission-webhook-8b7f74576-pbxsv     1/1     Running   0          2m41s
      longhorn-manager-pzgsp                         1/1     Running   0          2m41s
      longhorn-driver-deployer-6bd59c9f76-lqczw      1/1     Running   0          2m41s
      longhorn-csi-plugin-mbwqz                      2/2     Running   0          100s
      csi-snapshotter-588457fcdf-22bqp               1/1     Running   0          100s
      csi-snapshotter-588457fcdf-2wd6g               1/1     Running   0          100s
      csi-provisioner-869bdc4b79-mzrwf               1/1     Running   0          101s
      csi-provisioner-869bdc4b79-klgfm               1/1     Running   0          101s
      csi-resizer-6d8cf5f99f-fd2ck                   1/1     Running   0          101s
      csi-provisioner-869bdc4b79-j46rx               1/1     Running   0          101s
      csi-snapshotter-588457fcdf-bvjdt               1/1     Running   0          100s
      csi-resizer-6d8cf5f99f-68cw7                   1/1     Running   0          101s
      csi-attacher-7bf4b7f996-df8v6                  1/1     Running   0          101s
      csi-attacher-7bf4b7f996-g9cwc                  1/1     Running   0          101s
      csi-attacher-7bf4b7f996-8l9sw                  1/1     Running   0          101s
      csi-resizer-6d8cf5f99f-smdjw                   1/1     Running   0          101s
      instance-manager-r-371b1b2e                    1/1     Running   0          114s
      instance-manager-e-7c5ac28d                    1/1     Running   0          114s
      engine-image-ei-df38d2e5-cv6nc                 1/1     Running   0          114s
    

Web-UI

Change the Web-UI type to LoadBalancer:

1
kubectl -n longhorn-system get svc
1
2
3
4
5
For Longhorn v0.8.0, the output should look like this, and the CLUSTER-IP of the longhorn-frontend is used to access the Longhorn UI:

NAME                TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
longhorn-backend    ClusterIP      10.20.248.250   <none>           9500/TCP       58m
longhorn-frontend   ClusterIP      10.20.245.110   <none>           80/TCP         58m

longhorn-ui

Here for more setup

This post is licensed under CC BY 4.0 by the author.