In this section, you’ll learn how to install Longhorn with Helm.

Prerequisites

  • Each node in the Kubernetes cluster where Longhorn will be installed must fulfill these requirements.
  • Helm v2.0+ must be installed on your workstation.

This script can be used to check the Longhorn environment for potential issues.

The initial settings for Longhorn can be customized using Helm options or by editing the deployment configuration file.

Notes on Installing Helm

For help installing Helm, refer to the official documentation.

If you’re using a Helm version prior to version 3.0, you need to install Tiller in your Kubernetes cluster with role-based access control (RBAC).

Installing Longhorn

  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. To install Longhorn with Helm 2, use this command:

    1. helm install longhorn/longhorn --name longhorn --namespace longhorn-system

    To install Longhorn with Helm 3, use these commands:

    1. kubectl create namespace longhorn-system
    2. helm install longhorn longhorn/longhorn --namespace longhorn-system
  4. To confirm that the deployment succeeded, run:

    1. kubectl -n longhorn-system get pod

    The result should look like the following:

    1. NAME READY STATUS RESTARTS AGE
    2. compatible-csi-attacher-d9fb48bcf-2rzmb 1/1 Running 0 8m58s
    3. csi-attacher-78bf9b9898-grn2c 1/1 Running 0 32s
    4. csi-attacher-78bf9b9898-lfzvq 1/1 Running 0 8m59s
    5. csi-attacher-78bf9b9898-r64sv 1/1 Running 0 33s
    6. csi-provisioner-8599d5bf97-c8r79 1/1 Running 0 33s
    7. csi-provisioner-8599d5bf97-fc5pz 1/1 Running 0 33s
    8. csi-provisioner-8599d5bf97-p9psl 1/1 Running 0 8m59s
    9. csi-resizer-586665f745-b7p6h 1/1 Running 0 8m59s
    10. csi-resizer-586665f745-kgdxs 1/1 Running 0 33s
    11. csi-resizer-586665f745-vsvvq 1/1 Running 0 33s
    12. engine-image-ei-e10d6bf5-pv2s6 1/1 Running 0 9m30s
    13. instance-manager-e-379373af 1/1 Running 0 8m41s
    14. instance-manager-r-101f13ba 1/1 Running 0 8m40s
    15. longhorn-csi-plugin-7v2dc 4/4 Running 0 8m59s
    16. longhorn-driver-deployer-775897bdf6-k4sfd 1/1 Running 0 10m
    17. longhorn-manager-79xgj 1/1 Running 0 9m50s
    18. longhorn-ui-9fbb5445-httqf 0/1 Running 0 33s
  5. To enable access to the Longhorn UI, you will need to set up an Ingress controller. Authentication to the Longhorn UI is not enabled by default. For information on creating an NGINX Ingress controller with basic authentication, refer to this section.

  6. Access the Longhorn UI using these steps.