Пострелушки с beeman longhorn
Upgrade Longhorn engine
After Longhorn Manager was upgraded, Longhorn Engine also need to be upgraded using Longhorn UI. See here for details.
Create Longhorn Volumes
Before you create Kubernetes volumes, you must first create a storage class. Use following command to create a StorageClass called .
Now you can create a pod using Longhorn like this:
The above yaml file contains two parts:
- Create a PVC using Longhorn StorageClass.
- Use it in the a Pod as a persistent volume:
More examples are available at
Documentation
Use CSI driver on RancherOS/CoreOS + RKE or K3S
Recover volume after unexpected detachment
Troubleshooting
You can click link at the bottom of the UI to download a zip file contains Longhorn related configuration and logs.
See here for the troubleshooting guide.
Uninstall Longhorn
Using kubectl
-
To prevent damaging the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc) first.
-
Create the uninstallation job to clean up CRDs from the system and wait for success:
Example output:
- Remove remaining components:
Tip: If you try first and get stuck there,
pressing then running can also help you remove Longhorn. Finally, don’t forget to cleanup remaining components.
Source code
Longhorn is 100% open source software. Project source code is spread across a number of repos:
- Longhorn engine — Core controller/replica logic https://github.com/longhorn/longhorn-engine
- Longhorn manager — Longhorn orchestration, includes Flexvolume driver for Kubernetes https://github.com/longhorn/longhorn-manager
- Longhorn UI — Dashboard https://github.com/longhorn/longhorn-ui
Requirements
- Docker v1.13+
- Kubernetes v1.14+.
-
has been installed on all the nodes of the Kubernetes cluster, and daemon is running on all the nodes.
- For GKE, recommended Ubuntu as guest OS image since it contains open-iscsi already.
- For Debian/Ubuntu, use to install.
- For RHEL/CentOS, use to install.
- For EKS with ,
use to install. You may need to edit cluster security group to allow ssh access.
- A host filesystem supports feature on the nodes to store the data. Currently we support:
- ext4
- XFS
On any Kubernetes cluster
Install Longhorn with kubectl
You can install Longhorn on any Kubernetes cluster using following command:
Google Kubernetes Engine (GKE) requires additional setup in order for Longhorn to function properly. If your are a GKE user, read this page before proceeding.
Install Longhorn with Helm
Then download Longhorn repository:
Now using following command to install Longhorn:
Helm2
Helm3
Longhorn will be installed in the namespace
One of the two available drivers (CSI and Flexvolume) would be chosen automatically based on the version of Kubernetes you use. See here for details.
A successful CSI-based deployment looks like this:
Accessing the UI
You can run to get Longhorn UI service:
To access Longhorn UI when installed from YAML manifest, you need to create an ingress controller.
See more about how to create an Nginx ingress controller with basic authentication here
See here for details.
On Kubernetes clusters Managed by Rancher 2.1 or newer
The easiest way to install Longhorn is to deploy Longhorn from Rancher Catalog.
- On Rancher UI, select the cluster and project you want to install Longhorn. We recommended to create a new project e.g. for Longhorn.
- Navigate to the screen. Select , find Longhorn in the list. Select , then click . Longhorn will be installed in the namespace.
After Longhorn has been successfully installed, you can access the Longhorn UI by navigating to the screen.
One benefit of installing Longhorn through Rancher catalog is Rancher provides authentication to Longhorn UI.
If there is a new version of Longhorn available, you will see an sign on the screen. You can click button to upgrade Longhorn manager. See more about upgrade .