Installation de longhorn
Introduction
Longhorn
Note
Sur un K3s mononode, l'intérêt de Longhorn est surtout dans les fonctionnalités de gestion du stockage, pas dans la haute disponibilité. Ce que Longhorn peut quand même apporter :
| Fonctionnalité | Intérêt sur 1 nœud |
|---|---|
| Réplication des volumes | ❌ Aucun réel gain |
| Tolérance à la panne du nœud | ❌ Impossible |
| Gestion des PVC via CSI | 🟡 Oui, mais K3s fournit déjà Local Path |
| Snapshots de volumes | 🟢 Intéressant |
| Clonage de volumes | 🟢 Intéressant |
| Backup de volumes | 🟢 Intéressant |
| Restore de volumes | 🟢 Intéressant |
| Expansion des PVC | 🟢 Intéressant |
| Migration d'un volume entre nœuds | ❌ Pas avec un seul nœud |
| Interface Web de gestion | 🟢 Pratique |
| Préparation à un futur cluster multi-nœuds | 🟡 Possible |
Installation
Vérification des pré-requis
sudo dnf -y install jq
curl -sSfL https://raw.githubusercontent.com/longhorn/longhorn/v1.8.2/scripts/environment_check.sh | bash
Note
Si les prérequis ne sont pas remplis exécutez les commandes ci-dessous:
sudo systemctl enable iscsid
sudo systemctl start iscsid
sudo modprobe iscsi_tcp
Fichier valeurs
cd /tmp
curl https://gitforge.dyndns.org/downloads/longhorn/longhorn-1.0.0.tar.gz -o longhorn-1.0.0.tar.gz
tar zxvf longhorn-1.0.0.tar.gz
cd longhorn-1.0.0
Configuration de longhorn
Avant de procéder à l'installation, éditez le fichier values.yaml afin d'adapter les variables à votre environnement.
Installation de longhorn
Il faut installer une version stable (1.12.1)
Ajouter le repo helm de longhorn
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm search repo longhorn --versions
Installer longhorn
helm upgrade longhorn longhorn/longhorn \
--install \
--atomic \
--cleanup-on-fail \
--version 1.12.1 \
--values=values.yaml \
--namespace longhorn-system \
--create-namespace
Note
Il peux y avoir des warning Release "longhorn" does not exist. Installing it now. I0927 10:13:05.753373 152979 warnings.go:107] "Warning: unrecognized format \"int64\""
L'installation prend du temps. Soyez patient !
Configuration de longhorn
helm upgrade longhorn-config ./longhorn-config \
--install \
--atomic \
--cleanup-on-fail \
--values=values.yaml \
--namespace longhorn-system \
--create-namespace
Création du backupTarget
kubectl -n longhorn-system patch backuptarget default \
--type=json \
-p='[
{
"op": "replace",
"path": "/spec/backupTargetURL",
"value": "s3://longhorn@us-east-1/"
},
{
"op": "replace",
"path": "/spec/credentialSecret",
"value": "s3-secret"
}
]'
Nettoyage
cd
rm -rf /tmp/longhorn-1.0.0*
| Version | Date | Change | Auteur |
|---|---|---|---|
| 1.0 | 28.09.2026 | Création | GMo |