本文说明如何通过 liteboxd-installer 一键部署 LiteBoxd。
Longhorn 专项配置可参考 docs/user/longhorn.md。
如果你要启用持久化 rootfs 沙箱,建议同时启用 Longhorn。
- 控制机可以 SSH 登录
master节点 master节点可以访问所有agent节点的 SSH 端口agent节点可以是内网 IP(installer 会通过master跳转连接)- 准备好各节点 root 密码(建议环境变量注入)
在仓库根目录执行:
make build-installer生成二进制:
bin/liteboxd-installer推荐从示例复制一份再修改:
cp tools/liteboxd-installer/examples/install.example.yaml /tmp/liteboxd-install.yaml至少需要按你的环境修改这些字段:
cluster.master.host/cluster.master.nodeIPcluster.agents[](可为空)cluster.master.password/cluster.agents[].passwordliteboxd.ingressHostliteboxd.images.api/gateway/webliteboxd.configDir(LiteBoxd kustomize patch 目录)storage.longhorn.enabled(是否由 installer 自动安装 Longhorn)
Longhorn 推荐配置(单机/测试环境):
storage:
longhorn:
enabled: true
namespace: "longhorn-system"
releaseName: "longhorn"
chartRepoURL: "https://charts.longhorn.io"
defaultReplicaCount: 1
setDefaultStorageClass: true
helmInstallScriptURL: "https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3"export MASTER_PASS='your-master-password'
export AGENT1_PASS='your-agent1-password'
export AGENT2_PASS='your-agent2-password'./bin/liteboxd-installer -f /tmp/liteboxd-install.yaml apply常用参数:
--log-file /tmp/liteboxd-installer.log:输出详细执行日志--state /tmp/liteboxd-state.json:指定状态文件位置--dry-run:只打印计划,不真正执行--cluster-only:仅维护 K3s/Cilium/Longhorn/节点,不部署 LiteBoxd
示例:
./bin/liteboxd-installer \
-f /tmp/liteboxd-install.yaml \
--log-file /tmp/liteboxd-installer.log \
apply如果中断或失败,可直接重试:
./bin/liteboxd-installer -f /tmp/liteboxd-install.yaml resume- 扩容:更新
cluster.agents后重新执行apply - 删除节点:
./bin/liteboxd-installer \
-f /tmp/liteboxd-install.yaml \
node remove --hosts 10.10.10.13- installer 为幂等设计,重复执行
apply是预期用法 - Cilium 配置未变化时会跳过安装/升级步骤,避免不必要网络抖动
- Longhorn 配置未变化时会跳过安装/升级步骤
storage.longhorn.enabled=true时,installer 会自动处理各节点open-iscsi依赖
kubectl get sc
kubectl -n longhorn-system get pods预期:
- 可看到
longhornStorageClass longhorn-system命名空间内核心组件处于 Running/Ready