- 📘Table of Contents
- 🖖Introduction
- ✨Steps
- 👉Step 1: Test if the system is ready for Longhorn
- 👉Step 2: Install Longhorn
- 👉Step 3: Check the status of the pods
- 👉Step 4: Check the status of the Longhorn system
- 👉Step 5: Get the storage class
- 👉Step 6: Create a basic authentication file
- 👉Step 7: Create a secret
- 👉Step 8: Set up a ingress controller
- 👉Step 9: Access the Longhorn UI
- 👉Step 10: Enable storage replica on worker notes
- 🔗Links
This document provides a step-by-step guide to installing Longhorn
on the servers (nodes) in the supercluster. The steps outlined in this document are essential for ensuring the proper functioning of the servers (nodes) and the supercluster.
bash <(curl -s https://raw.githubusercontent.com/longhorn/longhorn/refs/tags/v1.7.2/scripts/environment_check.sh)
Let's see some common problems.
- Problem 1: A kernel module is missing
modinfo iscsi_tcp # Check if the module is available
sudo modprobe iscsi_tcp # Load the module
echo "iscsi_tcp" | sudo tee -a /etc/modules # Add the module to the list of modules to load at boot
lsmod | grep iscsi_tcp # Check if the module is loaded
- Problem 2: The multipathd service is running
sudo systemctl stop multipathd # Stop the multipathd service
sudo systemctl disable multipathd # Disable the multipathd service
systemctl status multipathd # Check the status of the multipathd service
- Problem 3: The nfs-common package is not installed
sudo apt-get update && sudo apt-get upgrade -y # Update and upgrade the system
sudo apt-get install -y nfs-common # Install the nfs-common package
dpkg -l | grep nfs-common # Check if the nfs-common package is installed
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.7.2/deploy/longhorn.yaml
# kubectl delete -f https://raw.githubusercontent.com/longhorn/longhorn/v1.7.2/deploy/longhorn.yaml
# kubectl get namespace longhorn-system -o json > longhorn-system.json
# sudo nano longhorn-system.json
# delete -> "kubernetes" -> "finalizers"
# kubectl replace --raw "/api/v1/namespaces/longhorn-system/finalize" -f longhorn-system.json
kubectl get pods --namespace longhorn-system --watch # OPTIONAL
kubectl -n longhorn-system get pods # OPTIONAL
kubectl get storageclass # OPTIONAL
USER=<USERNAME_HERE>; PASSWORD=<PASSWORD_HERE>; echo "${USER}:$(openssl passwd -stdin -apr1 <<< ${PASSWORD})" >> auth
kubectl create secret generic basic-auth -n longhorn-system --from-file=auth
rm auth
# kubectl delete secret basic-auth -n longhorn-system
kubectl apply -f Ingress.yaml
# Service name: longhorn-frontend
# Namespace: longhorn-system
# Port: 8080
kubectl get ingress -A
kubectl label node node01 longhorn.io/target=true
kubectl label node node02 longhorn.io/target=true
kubectl label node node03 longhorn.io/target=true
kubectl label node node01 node-role.kubernetes.io/longhorn=true
kubectl label node node02 node-role.kubernetes.io/longhorn=true
kubectl label node node03 node-role.kubernetes.io/longhorn=true
- 👯 Web hosting company EliasDH.com.
- 📫 How to reach us elias.dehondt@outlook.com