Longhorn Installation Guide

Prerequisites:

  1. Kubernetes cluster: Ensure that each node fulfills the installation requirements. Install iscsi example for Rocky Linux
    kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.2/deploy/prerequisite/longhorn-iscsi-installation.yaml
    
  2. Your workstation: Install Helm v3.0 or later

Installing Longhorn (Only on Master Node)

  1. Add the Longhorn Helm repository:
    helm repo add longhorn https://charts.longhorn.io
    
  2. Fetch the latest charts from the repository:
    helm repo update
    
  3. Create Longhorn Values Configuration FileCreate longhorn-values.yaml to update the replica count ensures consistent configuration
    defaultSettings:
      defaultReplicaCount: 1
    persistence:
      defaultClassReplicaCount: 1
    
  4. Install Longhorn in the longhorn-system namespace with configuration.
    helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.7.3 -f longhorn-values.yaml
    
  5. To confirm that the deployment succeeded, run:
    kubectl -n longhorn-system get pod
    

Note: To enable access to the Longhorn UI, you must set up an Ingress controller. Authentication to the Longhorn UI is not enabled by default.

Using CLI ( if required )

  1. Edit the StorageClass longhorn using the kubectl edit command:
    kubectl edit sc longhorn
    

  2. Change the numberOfReplicas to 1 everywhere in the StorageClass configuration file

  3. Save the changes made to the Longhorn StorageClass configuration file.