Longhorn
Longhorn
Distributed block storage for the cluster, installed via Helm (longhorn/longhorn, chart version 1.12.1) into longhorn-system.
Node prerequisites
Each node needs open-iscsi and nfs-common installed and iscsid enabled before install:
1
2
3
sudo apt-get update
sudo apt-get install -y open-iscsi nfs-common
sudo systemctl enable --now iscsid
Install
1
2
3
4
5
helm repo add longhorn https://charts.longhorn.io
helm repo update
kubectl create namespace longhorn-system
helm install longhorn longhorn/longhorn --namespace longhorn-system --values=values.yaml --version 1.12.1
kubectl apply -f ingress.yaml
Scheduling
cm4-left is the control-plane node and carries the node-role.kubernetes.io/master=true:NoSchedule taint. values.yaml adds matching tolerations to the manager, driver, and UI components so Longhorn’s storage components — and therefore storage capacity — span all 3 nodes instead of just the 2 workers.
Storage classes
persistence.defaultClass: false — the longhorn StorageClass is created but not set as the cluster default, so local-path remains the default StorageClass. Volumes opt in explicitly with storageClassName: longhorn. Default replica count is 3 (one copy per node), set via persistence.defaultClassReplicaCount.
Data lives under /var/lib/longhorn on each node (defaultDataPath), formatted ext4 (defaultFsType).
Ingress
Fronted by Traefik via ingress.yaml, routing both longhorn. and www.longhorn. hosts to the longhorn-frontend service on port 80, TLS terminated using the namespace’s local-example-com-tls certificate from cert-manager.