离线安装(allinone)
当前安装方式可以仅通过运行一个容器快速体验到 Rainbond 完整功能。仅适用于体验 Rainbond 功能或者个人开发环境。支持 Windows
、MacOS
、Linux
三大操作系统,以及 x86_64
、Arm64
两种主流架构。
前提
caution
- 安装 Docker
- 可用内存至少大于 4G,推荐 8G 以上
- 可用磁盘 50G 以上
- 机器上 80、443、6060、6443、7070、8443 端口可用
注意: 如果是centos 8 则需要执行以下命令。
echo iptable_raw > /etc/modules-load.d/iptable_raw.conf
部署流程
- Linux
- Linux Arm64
1. 准备 dind 镜像和离线安装所需 tar 包
- 在有网络的环境下提前准备好 Rainbond dind 镜像和离线安装所需 tar 包。
mkdir -p ~/build_offline && cd ~/build_offline
wget https://rainbond-pkg.oss-cn-shanghai.aliyuncs.com/offline/5.X/rainbond-offline-v5.10.1-amd64.tar
docker pull registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-dind-allinone
vim Dockerfile
- 粘贴以下内容到 Dockerfile 里
FROM registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-dind-allinone
COPY rainbond-offline-v5.10.1-amd64.tar /app/offline.tar
- 保存后继续执行以下命令
docker build -t registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-dind-allinone .
docker save -o rainbond-v5.10.1-dind-allinone.tar registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-dind-allinone
- 导入 tar 包到你需要离线安装的服务器中。
docker load -i rainbond-v5.10.1-dind-allinone.tar
2. 设置 EIP 环境变量(非必填)
你需要指定一个 IP 地址,在部署完成后,将使用该 IP 地址访问 Rainbond 控制台。该 IP 通过环境变量 EIP 进行设置。
该地址可以是部署机器上的公网 IP 或内网 IP。IP 地址可以通过执行 ifconfig
命令获得。
caution
当你填写内网IP,如 192.168.3.25 时,切换网络环境后可能无法访问。因此如果仅本地测试体验,可以填写本地回环地址。
如 export EIP=127.0.0.1
export EIP=<你的IP地址>
3. 启动 Rainbond
docker run --privileged -d -p 7070:7070 -p 80:80 -p 443:443 -p 6060:6060 -p 8443:8443 \
--name=rainbond-allinone --restart=on-failure \
-v ~/.ssh:/root/.ssh \
-v ~/rainbonddata:/app/data \
-v /opt/rainbond:/opt/rainbond \
-e EIP=$EIP \
registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-dind-allinone \
&& docker logs -f rainbond-allinone
执行完上述命令后,耐心等待 5-10 分钟,可以看到如下日志输出,表示 Rainbond 已启动完成
安装日志输出如下:
2022-10-11 11:44:49 WARN: Too little free disk space, recommended disk space greater than 50G
2022-10-11 11:44:49 INFO: Memory: 7821 MB, CPUs: 2, Disk: 31884 MB
2022-10-11 11:44:49 INFO: move images
2022-10-11 11:45:05 INFO: K3s is starting, please wait ············································
2022-10-11 11:47:09 INFO: K3s started successfully
namespace/rbd-system created
2022-10-11 11:47:09 INFO: Create namespace rbd-system
NAME: rainbond-operator
LAST DEPLOYED: Tue Oct 11 11:47:16 2022
NAMESPACE: rbd-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
2022-10-11 11:47:17 INFO: Helm rainbond-operator installed
2022-10-11 11:47:19 INFO: Rainbond Region installed
2022-10-11 11:47:19 INFO: Rainbond Region is starting, please wait ············································
2022-10-11 11:48:36 INFO: Rainbond Region started successfully
2022-10-11 11:48:38 INFO: K3s is restarting, please wait ············································
2022-10-11 11:50:19 INFO: K3s restarted successfully
pod "rbd-chaos-9f6nf" deleted
2022-10-11 11:50:22 INFO: Rainbond console is starting, please wait ············································
2022-10-11 11:50:38 INFO: Rainbond started successfully, Please pass http://47.105.90.153:7070 Access Rainbond
1. 准备 dind 镜像和离线安装所需 tar 包
- 在有网络的环境下提前准备好 Rainbond dind 镜像和离线安装所需 tar 包。
mkdir -p ~/build_offline && cd ~/build_offline
wget https://rainbond-pkg.oss-cn-shanghai.aliyuncs.com/offline/5.X/rainbond-offline-v5.10.1-arm64.tar
docker pull registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-arm64-dind-allinone
vim Dockerfile
- 粘贴以下内容到 Dockerfile 里
FROM registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-arm64-dind-allinone
COPY rainbond-offline-v5.10.1-arm64.tar /app/offline.tar
- 保存后继续执行以下命令
docker build -t registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-arm64-dind-allinone .
docker save -o rainbond-v5.10.1-arm64-dind-allinone.tar registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-arm64-dind-allinone
- 导入 tar 包到目标服务器中。
docker load -i rainbond-v5.10.1-arm64-dind-allinone.tar
2. 设置 EIP 环境变量(非必填)
你需要指定一个 IP 地址,在部署完成后,将使用该 IP 地址访问 Rainbond 控制台。该 IP 通过环境变量 EIP 进行设置。
该地址可以是部署机器上的公网 IP 或内网 IP。IP 地址可以通过执行 ifconfig
命令获得。
caution
当你填写内网IP,如 192.168.3.25 时,切换网络环境后可能无法访问。因此如果仅本地测试体验,可以填写本地回环地址。
如 export EIP=127.0.0.1
export EIP=<你的IP地址>
3. 启动 Rainbond
docker run --privileged -d -p 7070:7070 -p 80:80 -p 443:443 -p 6060:6060 -p 8443:8443 \
--name=rainbond-allinone --restart=on-failure \
-v ~/.ssh:/root/.ssh \
-v ~/rainbonddata:/app/data \
-v /opt/rainbond:/opt/rainbond \
-e EIP=$EIP \
registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.10.1-arm64-dind-allinone \
&& docker logs -f rainbond-allinone
执行完上述命令后,耐心等待 5-10 分钟,可以看到如下日志输出,表示 Rainbond 已启动完成
安装日志输出如下:
2022-10-11 11:44:49 WARN: Too little free disk space, recommended disk space greater than 50G
2022-10-11 11:44:49 INFO: Memory: 7821 MB, CPUs: 2, Disk: 31884 MB
2022-10-11 11:44:49 INFO: move images
2022-10-11 11:45:05 INFO: K3s is starting, please wait ············································
2022-10-11 11:47:09 INFO: K3s started successfully
namespace/rbd-system created
2022-10-11 11:47:09 INFO: Create namespace rbd-system
NAME: rainbond-operator
LAST DEPLOYED: Tue Oct 11 11:47:16 2022
NAMESPACE: rbd-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
2022-10-11 11:47:17 INFO: Helm rainbond-operator installed
2022-10-11 11:47:19 INFO: Rainbond Region installed
2022-10-11 11:47:19 INFO: Rainbond Region is starting, please wait ············································
2022-10-11 11:48:36 INFO: Rainbond Region started successfully
2022-10-11 11:48:38 INFO: K3s is restarting, please wait ············································
2022-10-11 11:50:19 INFO: K3s restarted successfully
pod "rbd-chaos-9f6nf" deleted
2022-10-11 11:50:22 INFO: Rainbond console is starting, please wait ············································
2022-10-11 11:50:38 INFO: Rainbond started successfully, Please pass http://47.105.90.153:7070 Access Rainbond
4. 补充离线版本镜像
- load 离线镜像的 tar 包
docker exec -ti rainbond-allinone bash
nerdctl -n k8s.io load < /app/offline.tar
- 给部分离线镜像重新打 tag
nerdctl -n k8s.io tag registry.cn-hangzhou.aliyuncs.com/goodrain/kaniko-executor:latest goodrain.me/kaniko-executor:latest
nerdctl -n k8s.io tag registry.cn-hangzhou.aliyuncs.com/goodrain/runner:v5.8.1-release goodrain.me/runner:latest
nerdctl -n k8s.io tag registry.cn-hangzhou.aliyuncs.com/goodrain/builder:v5.8.1-release goodrain.me/builder:latest
- 切换 rbdcomponent 资源里的 rbd-resource-proxy。
kubectl edit rbdcomponent rbd-resource-proxy -n rbd-system
- 修改下面命令打开的 yaml 中
image:
后面的内容
registry.cn-hangzhou.aliyuncs.com/goodrain/resource-proxy:v5.10.1-release
修改结果如下:
spec:
image: registry.cn-hangzhou.aliyuncs.com/goodrain/resource-proxy:v5.10.1-release
- 查看 goodrain.me 的密码
kubectl get rainbondcluster -n rbd-system -oyaml|grep password
- 登陆本地的
goodrain.me
镜像仓库,用户名为admin
,密码就是你刚刚获取到的。
nerdctl login goodrain.me
- 推送离线镜像到
goodrain.me
镜像仓库
nerdctl -n k8s.io push goodrain.me/kaniko-executor:latest
nerdctl -n k8s.io push goodrain.me/runner:latest
nerdctl -n k8s.io push goodrain.me/builder:latest
- 最后一步,补充
chaos
的 tag
kubectl edit rbdcomponent rbd-chaos -n rbd-system
修改结果如下:
spec:
args:
- --db-type=sqlite
- --kaniko-image=goodrain.me/kaniko-executor:latest
访问 Rainbond
此时,你已经成功安装了离线版 Rainbond,你现在可以根据日志中提示的访问地址进行访问,开始你的体验之旅
常见问题
安装问题:
- 单节点体验版本安装过程中如果长时间未完成,那么请参考文档 单机体验版本安装问题排查指南 进行故障排查。
- 离线安装目前仅支持 Allinone,如需集群版本安装请参阅 Rainbond企业版