Skip to main content

Longhorn

Longhorn is a lightweight distributed block storage system for cloud native storage Kubernetes that allows you to replicate storage to Kubernetes clusters. Once Longhorn is installed, it adds persistent volume support to the Kubernetes cluster using containers and microservices.

Longhorn creates a dedicated storage controller for each block device volume and replicates the volume across multiple nodes.

Version Supported

Prerequisites

  • Kubernetes cluster is 1.21 or higher.

  • Different Operating Systems (OS) have different requirements for the Longhorn installation. Use the links below to learn more about the requirements for your OS.

Parameters

The table lists commonly used parameters you can configure when adding this pack. Refer to the Settings Reference resource for a complete list of Longhorn parameters and their descriptions.

ParameterDescriptionDefault
pack.namespaceThe namespace where the Longhorn will be installed. If the namespace does not exist, it will be created.longhorn-system
charts.longhorn.global.persistence.defaultClassThe volume type to be used.true
charts.longhorn.global.persistence.defaultFsTypeThe default file system.ext4
charts.longhorn.global.persistence.defaultClassReplicaCountThe default number of copies of data store in your cluster.3
charts.longhorn.global.persistence.defaultDataLocalityThe default location where data computation will occur.disabled
charts.longhorn.global.persistence.reclaimPolicyThe policy that regulates dynamically provisioned volumes when its corresponding PersistentVolumeClaim is deleted. The default policy is Delete. This means that a dynamically provisioned volume will be automatically deleted when corresponding PersistentVolumeClaim is deleted. For important data, it is more appropriate to use the "Retain" policy.Delete
charts.longhorn.global.persistence.migratableThe ability to transfer data to another data storage systems.false
charts.longhorn.global.persistence.recurringJobSelector.enableThe management of recurring jobs. You can enable this feature and type a comma-separated list of jobs to activate.false

Usage

The official Longhorn documentation contains several guides and examples. The following guides are a good place to start when learning how to use Longhorn.

We also recommend you check out the Examples section of the Longhorn documentation. The examples section contains several use cases of how to configure Longhorn.

Known Issues

The following known issues exist in the Longhorn 1.5.X release.

  • A deadlock may occurs when using a RWX volume and a cluster node is recreated. This issue is disclosed as a known issue in the Longhorn GitHub repository] and a fix is on the roadmap. Workarounds provided by the community can be found in the issue discussion.

  • Rebooting or upgrading a cluster with Longhorn has a small possibility of triggering a race condition that causes pods to be stuck in the terminating state. This issue is related to a known issue in the Longhorn GitHub repository and a fix is on the roadmap.

  • Using Longhorn together in airgap environments with an external registry requires you to update the Longhorn pack image references to use the base URL of the Harbor registry. For more information, refer to Longhorn Deployer Stuck in Init State in Airgap Environments.

Terraform

When using this Pack as a base layer, you need the following terraform code.

data "spectrocloud_registry" "public_registry" {
name = "Public Repo"
}

data "spectrocloud_pack_simple" "csi-longhorn" {
name = "longhorn"
version = "1.5.1"
type = "helm"
registry_uid = data.spectrocloud_registry.public_registry.id
}

References