### Example Successful Longhorn Installation Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-flux This output shows an example of a successful Longhorn installation, indicating that all necessary pods are running. ```text NAME READY STATUS RESTARTS AGE longhorn-ui-b7c844b49-w25g5 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-b34d5db1fe1e2d52bcfb308be3166cfc 1/1 Running 0 114s engine-image-ei-df38d2e5-cv6nc 1/1 Running 0 114s ``` -------------------------------- ### Example Successful Longhorn Installation Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-argocd This output shows an example of a successful Longhorn installation, listing the running pods and their status in the 'longhorn-system' namespace. ```text NAME READY STATUS RESTARTS AGE longhorn-ui-b7c844b49-w25g5 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-b34d5db1fe1e2d52bcfb308be3166cfc 1/1 Running 0 114s engine-image-ei-df38d2e5-cv6nc 1/1 Running 0 114s ``` -------------------------------- ### Complete fleet.yaml for Longhorn Installation Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-fleet An example of a complete fleet.yaml file that includes namespace, Helm chart details, and CRD diff configurations for installing Longhorn. ```yaml defaultNamespace: longhorn-system helm: repo: https://charts.longhorn.io chart: longhorn version: v1.11.0 releaseName: longhorn diff: comparePatches: - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition name: engineimages.longhorn.io operations: - {"op": "replace", "path": "/status"} - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition name: nodes.longhorn.io operations: - {"op": "replace", "path": "/status"} - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition name: volumes.longhorn.io operations: - {"op": "replace", "path": "/status"} ``` -------------------------------- ### Perform Longhorn Installation Preflight Checks Source: https://longhorn.io/docs/1.11.0/advanced-resources/longhornctl Execute preflight dependencies installation and setup before installing Longhorn. ```bash longhornctl install preflight ``` -------------------------------- ### Example Longhorn Service Output Source: https://longhorn.io/docs/1.11.0/deploy/accessing-the-ui This is an example output of the `kubectl get svc` command for Longhorn, showing the ClusterIP for `longhorn-frontend`. Use this IP to access the UI. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE longhorn-backend ClusterIP 10.20.248.250 9500/TCP 58m longhorn-frontend ClusterIP 10.20.245.110 80/TCP 58m ``` -------------------------------- ### Install Cryptsetup (SUSE/OpenSUSE) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the cryptsetup utility, used for Longhorn's volume encryption with LUKS2 format, on SUSE or OpenSUSE. ```bash zypper install cryptsetup ``` -------------------------------- ### Example Output: IOMMU Enabled Source: https://longhorn.io/docs/1.11.0/v2-data-engine/features/interrupt-mode This is an example of the expected output when IOMMU is enabled, showing device paths within IOMMU groups. ```bash /sys/kernel/iommu_groups/0/devices/0000:e6:0b.1 /sys/kernel/iommu_groups/1/devices/0000:34:0a.6 /sys/kernel/iommu_groups/2/devices/0000:a0:00.0 ``` -------------------------------- ### Example of 'Package Has No Installation Candidate' Error Source: https://longhorn.io/docs/1.11.0/v2-data-engine/troubleshooting This is an example of the error message encountered during installation on Debian machines when the required kernel module package is not found. ```text apt install -y linux-modules-extra-`uname -r` Reading package lists... Done Building dependency tree... Done Reading state information... Done Package linux-modules-extra-5.15.0-67-generic is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'linux-modules-extra-5.15.0-67-generic' has no installation candidate ``` -------------------------------- ### Install Preflight Dependencies with Longhorn CLI Source: https://longhorn.io/docs/1.11.0/v2-data-engine/quick-start Use the `install preflight` command to set up necessary dependencies before installing Longhorn. Some distributions may require a reboot and re-running the command. ```bash master:~# ./longhornctl install preflight --enable-spdk INFO[2024-01-01T00:00:03Z] Initializing preflight installer INFO[2024-01-01T00:00:03Z] Cleaning up preflight installer INFO[2024-01-01T00:00:03Z] Running preflight installer INFO[2024-01-01T00:00:03Z] Installing dependencies with package manager INFO[2024-01-01T00:00:10Z] Installed dependencies with package manager INFO[2024-01-01T00:00:10Z] Cleaning up preflight installer INFO[2024-01-01T00:00:10Z] Completed preflight installer. Use 'longhornctl check preflight' to check the result. ``` -------------------------------- ### Install Cryptsetup (Debian/Ubuntu) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the cryptsetup utility, used for Longhorn's volume encryption with LUKS2 format, on Debian or Ubuntu. ```bash apt-get install cryptsetup ``` -------------------------------- ### Basic Longhorn Installation with HTTPRoute Source: https://longhorn.io/docs/1.11.0/deploy/accessing-the-ui/longhorn-httproute Install Longhorn using Helm, enabling HTTPRoute generation and specifying gateway parent references and hostnames. ```bash helm install longhorn longhorn/longhorn \ --namespace longhorn-system \ --create-namespace \ --set "httproute.enabled=true" \ --set "httproute.parentRefs[0].name=my-gateway" \ --set "httproute.parentRefs[0].namespace=default" \ --set "httproute.hostnames[0]=longhorn.example.com" ``` -------------------------------- ### Install NFSv4 Client (SUSE/OpenSUSE) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the NFSv4 client userspace daemon and utilities on SUSE or OpenSUSE systems. ```bash zypper install nfs-client ``` -------------------------------- ### Install Preflight Dependencies with Longhorn CLI Source: https://longhorn.io/docs/1.11.0/deploy/install Use the `install preflight` command to set up necessary dependencies before installing Longhorn. Some immutable distributions may require a reboot and re-running this command. ```bash ./longhornctl install preflight ``` -------------------------------- ### Monitor Longhorn Installation with kubectl Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-kubectl Watch the pods being created in the `longhorn-system` namespace to monitor the installation progress. This command will stream updates as pods start and change state. ```bash kubectl get pods \ --namespace longhorn-system \ --watch ``` -------------------------------- ### Install open-iscsi on SUSE/openSUSE Source: https://longhorn.io/docs/1.11.0/deploy/install Installs the open-iscsi package and enables/starts the iscsid service on SUSE and openSUSE systems. ```bash zypper install open-iscsi systemctl enable iscsid systemctl start iscsid ``` -------------------------------- ### Install Cryptsetup (RHEL/CentOS/EKS AmazonLinux2) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the cryptsetup utility, used for Longhorn's volume encryption with LUKS2 format, on RHEL, CentOS, or EKS with AmazonLinux2. ```bash yum install cryptsetup ``` -------------------------------- ### Verify Preflight Check After Installation Source: https://longhorn.io/docs/1.11.0/v2-data-engine/quick-start After installing preflight dependencies, run the `check preflight` command again to confirm that all environment settings are correct. ```bash master:~# ./longhornctl check preflight --enable-spdk INFO[2024-01-01T00:00:13Z] Initializing preflight checker INFO[2024-01-01T00:00:13Z] Cleaning up preflight checker INFO[2024-01-01T00:00:13Z] Running preflight checker INFO[2024-01-01T00:00:16Z] Retrieved preflight checker result: worker1: info: - Service iscsid is running - NFS4 is supported - Package nfs-common is installed - Package open-iscsi is installed - CPU instruction set sse4_2 is supported - HugePages is enabled - Module nvme_tcp is loaded - Module uio_pci_generic is loaded ``` -------------------------------- ### Install longhornctl Binary Source: https://longhorn.io/docs/1.11.0/advanced-resources/longhornctl/install-longhornctl Install the validated longhornctl binary to the system's executable path, typically /usr/local/bin/longhornctl. ```bash sudo install longhornctl-linux-${ARCH} /usr/local/bin/longhornctl ``` -------------------------------- ### Install Longhorn using Helm Source: https://longhorn.io/docs/1.11.0/deploy/install/airgap Install Longhorn using Helm after configuring the `values.yaml` file for an airgapped environment. ```bash helm install longhorn ./chart --namespace longhorn-system --create-namespace ``` -------------------------------- ### Install Device Mapper (SUSE/OpenSUSE) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the device mapper userspace tool on SUSE or OpenSUSE, which is foundational for Longhorn's disk encryption and volume management. ```bash zypper install device-mapper ``` -------------------------------- ### Install open-iscsi on RHEL/CentOS/EKS Source: https://longhorn.io/docs/1.11.0/deploy/install Installs the iscsi-initiator-utils package, sets the initiator name, and enables/starts the iscsid service on RHEL, CentOS, and EKS worker nodes with Amazon Linux 2. ```bash yum --setopt=tsflags=noscripts install iscsi-initiator-utils echo "InitiatorName=$(/sbin/iscsi-iname)" > /etc/iscsi/initiatorname.iscsi systemctl enable iscsid systemctl start iscsid ``` -------------------------------- ### Install Longhorn with Custom values.yaml via Helm Source: https://longhorn.io/docs/1.11.0/advanced-resources/deploy/customizing-default-settings Install Longhorn using a customized `values.yaml` file with the `--values` flag in Helm. ```bash helm install longhorn longhorn/longhorn \ --namespace longhorn-system \ --create-namespace \ --values values.yaml ``` -------------------------------- ### Install Longhorn on OKD with Helm Source: https://longhorn.io/docs/1.11.0/advanced-resources/os-distro-specific/okd-support Use this Helm command to install Longhorn with OpenShift specific configurations enabled. Ensure to set the correct OAuth proxy repository and tag. ```bash helm install longhorn longhorn/longhorn \ --namespace longhorn-system \ --create-namespace \ --set openshift.enabled=true \ --set image.openshift.oauthProxy.repository=quay.io/openshift/origin-oauth-proxy \ --set image.openshift.oauthProxy.tag=4.18 ``` -------------------------------- ### Install Preflight with Kubeconfig and Specific Image Source: https://longhorn.io/docs/1.11.0/v2-data-engine/quick-start Install preflight dependencies using the Longhorn CLI, specifying the kubeconfig path and a particular Longhorn CLI image version. ```bash longhornctl --kubeconfig ~/.kube/config --image longhornio/longhorn-cli:v1.11.0 install preflight --enable-spdk ``` -------------------------------- ### Add Fleet Helm Repository and Install Fleet CRDs and Components Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-fleet Add the Fleet Helm repository and then install the Fleet CRDs and core components into the 'cattle-fleet-system' namespace. Ensure you wait for the deployment to complete. ```bash helm repo add fleet https://rancher.github.io/fleet-helm-charts/ helm -n cattle-fleet-system install --create-namespace --wait fleet-crd fleet/fleet-crd helm -n cattle-fleet-system install --create-namespace --wait fleet fleet/fleet ``` -------------------------------- ### Example: Full Ingress Deployment and Verification Source: https://longhorn.io/docs/1.11.0/deploy/accessing-the-ui/longhorn-ingress Demonstrates a complete workflow including creating the auth file, secret, Ingress manifest, applying it, and verifying access via curl. This example uses specific credentials and shows the resulting secret and Ingress output. ```bash $ USER=foo; PASSWORD=bar; echo "${USER}:$(openssl passwd -stdin -apr1 <<< ${PASSWORD})" >> auth $ cat auth foo:$apr1$FnyKCYKb$6IP2C45fZxMcoLwkOwf7k0 $ kubectl -n longhorn-system create secret generic basic-auth --from-file=auth secret/basic-auth created $ kubectl -n longhorn-system get secret basic-auth -o yaml apiVersion: v1 data: auth: Zm9vOiRhcHIxJEZueUtDWUtiJDZJUDJDNDVmWnhNY29Md2tPd2Y3azAK kind: Secret metadata: creationTimestamp: "2020-05-29T10:10:16Z" name: basic-auth namespace: longhorn-system resourceVersion: "2168509" selfLink: /api/v1/namespaces/longhorn-system/secrets/basic-auth uid: 9f66233f-b12f-4204-9c9d-5bcaca794bb7 type: Opaque $ echo " apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: longhorn-ingress namespace: longhorn-system annotations: # type of authentication nginx.ingress.kubernetes.io/auth-type: basic # prevent the controller from redirecting (308) to HTTPS nginx.ingress.kubernetes.io/ssl-redirect: 'false' # name of the secret that contains the user/password definitions nginx.ingress.kubernetes.io/auth-secret: basic-auth # message to display with an appropriate context why the authentication is required nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required ' spec: rules: - http: paths: - pathType: Prefix path: "/" backend: service: name: longhorn-frontend port: number: 80 " | kubectl -n longhorn-system create -f - ingress.networking.k8s.io/longhorn-ingress created $ kubectl -n longhorn-system get ingress NAME HOSTS ADDRESS PORTS AGE longhorn-ingress * 45.79.165.114,66.228.45.37,97.107.142.125 80 2m7s $ curl -v http://97.107.142.125/ * Trying 97.107.142.125... * TCP_NODELAY set * Connected to 97.107.142.125 (97.107.142.125) port 80 (#0) > GET / HTTP/1.1 > Host: 97.107.142.125 > User-Agent: curl/7.64.1 > Accept: */* > < HTTP/1.1 401 Unauthorized < Server: openresty/1.15.8.1 < Date: Fri, 29 May 2020 11:47:33 GMT < Content-Type: text/html < Content-Length: 185 < Connection: keep-alive < WWW-Authenticate: Basic realm="Authentication Required" < ``` -------------------------------- ### Example Longhorn Pods Status Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-helm-controller This output shows the expected status of Longhorn pods after a successful installation, indicating that all components are running. ```text NAME READY STATUS RESTARTS AGE csi-attacher-85c7684cfd-67kqc 1/1 Running 0 29m csi-attacher-85c7684cfd-jbddj 1/1 Running 0 29m csi-attacher-85c7684cfd-t85bw 1/1 Running 0 29m csi-provisioner-68cdb896-46d9q 1/1 Running 0 29m csi-provisioner-68cdb896-dgf5f 1/1 Running 0 29m csi-provisioner-68cdb896-mh8q7 1/1 Running 0 29m csi-resizer-86dd765b9-d27cs 1/1 Running 0 29m csi-resizer-86dd765b9-scqxm 1/1 Running 0 29m csi-resizer-86dd765b9-zpcv7 1/1 Running 0 29m csi-snapshotter-65b46b8749-dtvh2 1/1 Running 0 29m csi-snapshotter-65b46b8749-g67fn 1/1 Running 0 29m csi-snapshotter-65b46b8749-nfgzm 1/1 Running 0 29m engine-image-ei-221c9c21-gd5d6 1/1 Running 0 29m engine-image-ei-221c9c21-v6clp 1/1 Running 0 29m engine-image-ei-221c9c21-zzdrt 1/1 Running 0 29m instance-manager-77d11dda6091967f9b30011c9876341b 1/1 Running 0 29m instance-manager-870c250b69a4fe01382ed46156d33f47 1/1 Running 0 29m instance-manager-a4099c5ce28b423c3cc2667906f4b0b4 1/1 Running 0 29m longhorn-csi-plugin-jfbh5 3/3 Running 0 29m longhorn-csi-plugin-w768w 3/3 Running 0 29m longhorn-csi-plugin-xcghm 3/3 Running 0 29m longhorn-driver-deployer-586bc86bf9-bkwk6 1/1 Running 0 30m longhorn-manager-c4xtv 1/1 Running 1 (30m ago) 30m longhorn-manager-kgqts 1/1 Running 0 30m longhorn-manager-n8xdr 1/1 Running 0 30m longhorn-ui-69667f9678-2lvxn 1/1 Running 0 30m longhorn-ui-69667f9678-2xmc9 1/1 Running 0 30m ``` -------------------------------- ### Longhorn CLI Preflight Check Source: https://longhorn.io/docs/1.11.0/deploy/install Runs a preflight check using the Longhorn CLI to verify the Kubernetes cluster environment meets Longhorn's requirements. This example shows the command execution and a sample output indicating service status, supported features, and installed packages. ```bash > longhornctl check preflight INFO[2025-08-22T12:58:40+08:00] Initializing preflight checker INFO[2025-08-22T12:58:40+08:00] Cleaning up preflight checker INFO[2025-08-22T12:58:42+08:00] Running preflight checker INFO[2025-08-22T12:58:49+08:00] Retrieved preflight checker result: ip-10-0-1-132: info: - Service iscsid is running - NFS4 is supported - Package nfs-client is installed - Package open-iscsi is installed - Package cryptsetup is installed - Package device-mapper is installed - Module dm_crypt is loaded warn: - Kube DNS "coredns" is set with fewer than 2 replicas; consider increasing replica count for high availability INFO[2025-08-22T12:58:49+08:00] Cleaning up preflight checker INFO[2025-08-22T12:58:50+08:00] Completed preflight checker ``` -------------------------------- ### Initializing the Longhorn Client Source: https://longhorn.io/docs/1.11.0/references/longhorn-client-python Demonstrates how to import the Longhorn client library and initialize a client instance using the Longhorn API endpoint. It covers both in-cluster and local access scenarios. ```APIDOC import longhorn # If automation/scripting tool is inside the same cluster in which Longhorn is installed longhorn_url = 'http://longhorn-frontend.longhorn-system/v1' # If forwarding `longhorn-frontend` service to localhost # kubectl port-forward services/longhorn-frontend 8080:http -n longhorn-system # longhorn_url = 'http://localhost:8080/v1' client = longhorn.Client(url=longhorn_url) ``` -------------------------------- ### Set Up NFS Backupstore Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/backup-and-restore/set-backup-target Configure an NFS backup target by providing the service URL. Custom mount options can be appended using the `nfsOptions` query parameter, which will replace the default options. ```url nfs://longhorn-test-nfs-svc.default:/opt/backupstore ``` ```url nfs://longhorn-test-nfs-svc.default:/opt/backupstore?nfsOptions=soft,timeo=330,retrans=3 ``` -------------------------------- ### Install Argo CD Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-argocd Installs Argo CD into the 'argocd' namespace and applies the core installation manifest. Ensure Argo CD CLI is installed on your workstation. ```bash kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml ``` -------------------------------- ### Deploy SMB/CIFS Credentials and Service Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/backup-and-restore/set-backup-target Deploy SMB/CIFS credentials and service using a generated Kustomize overlay. Set environment variables for username and password, then run the script to generate the overlay and apply it. ```bash export CIFS_USERNAME="example-cifs-username" export CIFS_PASSWORD="example-cifs-password" ./scripts/generate-backupstore-credentials.sh cifs kubectl apply -k deploy/backupstores/overlays/generated-credentials/cifs ``` -------------------------------- ### Initialize Longhorn Python Client Source: https://longhorn.io/docs/1.11.0/references/longhorn-client-python Import the longhorn library and create a client instance. Choose the correct URL based on whether your script is inside or outside the cluster. ```python import longhorn # If automation/scripting tool is inside the same cluster in which Longhorn is installed longhorn_url = 'http://longhorn-frontend.longhorn-system/v1' # If forwarding `longhorn-frontend` service to localhost longhorn_url = 'http://localhost:8080/v1' client = longhorn.Client(url=longhorn_url) ``` -------------------------------- ### Install open-iscsi on Debian/Ubuntu Source: https://longhorn.io/docs/1.11.0/deploy/install Installs the open-iscsi package on Debian and Ubuntu systems. ```bash apt-get install open-iscsi ``` -------------------------------- ### Verify longhornctl Installation Source: https://longhorn.io/docs/1.11.0/advanced-resources/longhornctl/install-longhornctl Confirm that longhornctl has been installed correctly by checking its version. ```bash longhornctl version ``` -------------------------------- ### Deploy Backup Store Credentials Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/backup-and-restore/set-backup-target Apply the generated Kustomize overlay to deploy the backup store credentials and service. ```shell kubectl apply -k deploy/backupstores/overlays/generated-credentials/azurite ``` -------------------------------- ### Generate Backup Store Credentials Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/backup-and-restore/set-backup-target Run this script to generate a Kustomize overlay for backup store credentials. Use `--no-encode` if your environment variables are already base64-encoded. ```shell ./scripts/generate-backupstore-credentials.sh azurite ``` -------------------------------- ### Install Common Snapshot Controller Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/csi-snapshot-support/enable-csi-snapshot-support Execute this command after downloading the snapshot controller files and updating the namespace. This should be done once per cluster. ```bash kubectl create -k deploy/kubernetes/snapshot-controller ``` -------------------------------- ### Monitor Installation Jobs Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-helm-controller Check the status of the Helm installation job to ensure it is running or has completed successfully. ```bash $ kubectl get jobs NAME COMPLETIONS DURATION AGE helm-install-longhorn-install 0/1 8s 8s ``` -------------------------------- ### Install NFSv4 Client (Debian/Ubuntu) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the NFSv4 client userspace daemon and utilities on Debian or Ubuntu systems. ```bash apt-get install nfs-common ``` -------------------------------- ### Kubernetes CSI Persistent Volume Example Source: https://longhorn.io/docs/1.11.0/references/examples Creates a PersistentVolume, PersistentVolumeClaim, and a Pod to demonstrate CSI volume usage with Longhorn. ```yaml apiVersion: v1 kind: PersistentVolume metadata: name: longhorn-vol-pv spec: capacity: storage: 2Gi volumeMode: Filesystem accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete storageClassName: longhorn csi: driver: driver.longhorn.io fsType: ext4 volumeAttributes: numberOfReplicas: '3' staleReplicaTimeout: '2880' volumeHandle: existing-longhorn-volume --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: longhorn-vol-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi volumeName: longhorn-vol-pv storageClassName: longhorn --- apiVersion: v1 kind: Pod metadata: name: volume-pv-test namespace: default spec: restartPolicy: Always containers: - name: volume-pv-test image: nginx:stable-alpine imagePullPolicy: IfNotPresent livenessProbe: exec: command: - ls - /data/lost+found initialDelaySeconds: 5 periodSeconds: 5 volumeMounts: - name: vol mountPath: /data ports: - containerPort: 80 volumes: - name: vol persistentVolumeClaim: claimName: longhorn-vol-pvc ``` -------------------------------- ### Configure Longhorn Installation Namespace in fleet.yaml Source: https://longhorn.io/docs/1.11.0/deploy/install/install-with-fleet Specify the namespace where Longhorn will be installed. This parameter is part of the fleet.yaml configuration. ```yaml defaultNamespace: longhorn-system ``` -------------------------------- ### Install Gateway API CRDs Source: https://longhorn.io/docs/1.11.0/deploy/accessing-the-ui/longhorn-httproute Apply the standard installation manifest for Gateway API CRDs to your Kubernetes cluster. ```bash kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml ``` -------------------------------- ### Backup Configuration Example Source: https://longhorn.io/docs/1.11.0/advanced-resources/data-recovery/recover-without-system This JSON snippet shows the structure of a backup configuration file, typically found within the backup destination folder. It contains essential information like the backup name, volume name, and snapshot name. ```json {"Name":"backup-72bcbdad913546cf","VolumeName":"volume_1","SnapshotName":"79758033-a670-4724-906f-41921f53c475"} ``` -------------------------------- ### Download and Run Longhorn CLI for ARM Source: https://longhorn.io/docs/1.11.0/deploy/install Download the `longhornctl` binary for ARM platforms, make it executable, and run a preflight check. ```bash curl -sSfL -o longhornctl https://github.com/longhorn/cli/releases/download/v1.11.0/longhornctl-linux-arm64 chmod +x longhornctl ./longhornctl check preflight ``` -------------------------------- ### Fix 'Package Has No Installation Candidate' Error Source: https://longhorn.io/docs/1.11.0/v2-data-engine/troubleshooting When encountering 'Package ... Has No Installation Candidate' errors on Debian, use this command to update package lists and install the correct kernel module. Ensure you replace the generic version with a valid one available in your package repositories. ```bash apt update -y apt install -y linux-modules-extra-5.15.0-76-generic ``` -------------------------------- ### Install NFSv4 Client (RHEL/CentOS/EKS AmazonLinux2) Source: https://longhorn.io/docs/1.11.0/deploy/install Install the NFSv4 client userspace daemon and utilities on RHEL, CentOS, or EKS with AmazonLinux2. ```bash yum install nfs-utils ``` -------------------------------- ### Configure Pod Anti-Affinity During Rancher Installation Source: https://longhorn.io/docs/1.11.0/advanced-resources/deploy/csi-pod-antiaffinity-preset Set the `csi.podAntiAffinityPreset` to 'hard' when installing Longhorn via Rancher by editing the YAML configuration. ```yaml csi: podAntiAffinityPreset: "hard" ``` -------------------------------- ### Install Preflight Dependencies with Kubeconfig Source: https://longhorn.io/docs/1.11.0/deploy/install Install preflight dependencies using the `longhornctl` command, specifying the kubeconfig path and the CLI image version. ```bash longhornctl --kubeconfig ~/.kube/config --image longhornio/longhorn-cli:v1.11.0 install preflight ``` -------------------------------- ### Deploy MinIO Credentials and Service Source: https://longhorn.io/docs/1.11.0/snapshots-and-backups/backup-and-restore/set-backup-target Apply the generated Kustomize configuration to deploy the MinIO backupstore credentials and service to the Kubernetes cluster. ```bash kubectl apply -k deploy/backupstores/overlays/generated-credentials/minio ``` -------------------------------- ### Enable Detailed Longhorn FlexVolume Logs Source: https://longhorn.io/docs/1.11.0/troubleshoot/troubleshooting Create a log file on the node or within the kubelet container to capture more detailed logs for the Longhorn FlexVolume driver. This is helpful for in-depth debugging. ```bash touch /var/log/longhorn_driver.log ```