Longhorn
Prerequisites
CentOS
sudo dnf install -y iscsi-initiator-utils
sudo systemctl enable --now iscsid
sudo dnf install -y nfs-utils
sudo dnf install -y epel-release jq
sudo dnf install -y curl util-linux findutils gawk
Check NFSv4 support is enabled in kernel
cat /boot/config-`uname -r`| grep CONFIG_NFS_V4_1
cat /boot/config-`uname -r`| grep CONFIG_NFS_V4_2
Optional
sudo dnf install -y targetcli
sudo targetcli ls
# sudo systemctl enable --now target
Ubuntu
sudo apt install -y open-iscsi
sudo systemctl enable --now iscsid
sudo apt install -y nfs-common
sudo apt install -y jq
Check NFSv4 support is enabled in kernel
cat /boot/config-`uname -r`| grep CONFIG_NFS_V4_1
cat /boot/config-`uname -r`| grep CONFIG_NFS_V4_2
Optional
sudo apt install -y targetcli-fb
sudo targetcli ls
# sudo systemctl enable --now target
Validate Environment
Master Node
version=$(curl https://api.github.com/repos/longhorn/longhorn/releases/latest | jq -r .tag_name)
curl https://raw.githubusercontent.com/longhorn/longhorn/$version/scripts/environment_check.sh -o install.sh
bash install.sh
rm -f install.sh
Installation
YAML install
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml
Helm Chart
Add chart repo
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm upgrade --install longhorn longhorn/longhorn --create-namespace --namespace longhorn-system
Custom configuration
helm show values longhorn/longhorn > values.longhorn.yaml
helm upgrade --install longhorn longhorn/longhorn --create-namespace --namespace longhorn-system --values values.longhorn.yaml
Update ui service port
kubectl edit service longhorn-frontend -n longhorn-system
spec:
ports:
- name: http
nodePort: 30001
type: NodePort