Longhorn
大约 1 分钟
支持多种安装方式,这里使用helm 安装
前置准备
yum --setopt=tsflags=noscripts install iscsi-initiator-utils
echo "InitiatorName=$(/sbin/iscsi-iname)" > /etc/iscsi/initiatorname.iscsi
systemctl enable iscsid
systemctl start iscsid
[root@zili01 ~]# systemctl status iscsid
● iscsid.service - Open-iSCSI
Loaded: loaded (/usr/lib/systemd/system/iscsid.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2023-12-04 16:36:21 CST; 9s ago
Docs: man:iscsid(8)
man:iscsiuio(8)
man:iscsiadm(8)
Main PID: 22072 (iscsid)
Status: "Ready to process requests"
Tasks: 1
Memory: 1.8M
CGroup: /system.slice/iscsid.service
└─22072 /sbin/iscsid -f
安装
仓库添加
helm repo add longhorn https://charts.longhorn.io
helm repo update
安装
在线安装
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.5.3
离线安装
helm pull longhorn/longhorn --version 1.5.3
tar -zxvf longhorn-1.5.3.tgz
# 可修改values,这里仅改了下存储的路径
defaultSettings:
defaultDataPath: /data/longhorn
# 安装
helm upgrade --install longhorn . -f values.yaml -n longhorn-system --create-namespace
❯ kubectl -n longhorn-system get pod
NAME READY STATUS RESTARTS AGE
csi-attacher-79b44f5d-5xvhb 1/1 Running 0 8m32s
...
...
longhorn-ui-7c667cb6fc-rxlwp 1/1 Running 0 10m
访问
longhorn 安装默认时安装了UI的。
若需要访问,安装ingress ,开启longhorn的ingress即可
ingress:
## Set to true to enable ingress record generation
enabled: true
host: longhorn.zili.work
annotations:
kubernetes.io/ingress.class: nginx
本机hosts文件中,添加记录。若生产环境,申请泛域名,做映射
192.168.2.149 longhorn.zili.work