在上篇 《国产化信创开源云原生平台》文章中,我们介绍了 Rainbond 作为可能是国内首个开源国产化信创平台,在支持国产化和信创方面的能力,并简要介绍了如何在国产化信创环境中在线部署 Kubernetes 和 Rainbond。
然而,对于大多数国产化信创环境,如银行、政府等机构,离线部署的需求更为普遍。值得注意的是,Rainbond 官网文档目前仅提供了在已有 Kubernetes 环境中离线部署 Rainbond 的指南。那么,为什么我们不提供离线部署 Kubernetes 的文档呢?Rainbond 开源社区与其他开源社区不同,Rainbond 始终对每一位开源用户提出的问题负责,并积极帮助解决问题。然而,这无疑会为社区支持团队带来额外的工作负担,特别是在处理本不属于 Rainbond 范畴的问题时。
因此,本篇文章将详细介绍如何在国产化信创环境下部署 Kubernetes 以及 Rainbond,希望能够为用户提供实用的指导,减少在部署过程中的困扰。
准备离线镜像和安装包
在有网的 Arm 环境中准备以下镜像和安装包。
Docker 离线包
下载 Docker 离线安装包和离线安装脚本。
Kubernetes 离线包
本次部署 K8s 版本为 v1.23.10
,采用 Rancher Kubernetes Engine 简称 RKE,是一个经过 CNCF 认证的 Kubernetes 安装程序。
在 Arm 环境中获取以下离线包。
Rainbond 离线包
在有网络的环境下提前准备好 Rainbond 所需的镜像。
获取 Rainbond Helm Chart 安装包
开始部署 Kubernetes
前提要求
在开始安装 K8s 之前请阅读 RKE 安装要求,该文档讲述了 RKE 对操作系统、软件、端口和 SSH 配置的要求,安装前,请检查您的节点是否满足这些要求。
部署 Docker
导入 Docker 离线包到所有节点,执行脚本安装 Docker。
导入 K8s 相关的离线包和 Docker 镜像到所有节点。
配置Docker用户
RKE 要求使用一个免密的用户用于后续的集群安装,该用户需有执行 Docker 的权限。
使用 Docker 用户登录检查是否有 Docker 执行权限。
编辑cluster.yml文件
使用 RKE 安装 K8s 集群需要使用 RKE 生成的配置文件,以下是我的示例,更多请参阅 RKE配置文件说明。
需要我们修改的只有 nodes
字段,如果导入镜像的镜像仓库地址不变则 yml 也无需修改,如有改动需修改 system_images
字段下所有镜像地址。
执行安装
执行以下命令开始安装 K8s。经验证麒麟V10必须 SSH 配置 AllowTcpForwarding yes
,不然就会报错,参阅 RKE SSH配置。
如果安装过程中遇到错误需要清理集群可使用以下脚本进行清理。
集群安装成功后需要将 kubeconfig 文件拷贝到默认路径下。
执行以下命令确认安装结果
开始部署 Rainbond
前提要求
每个节点都需要安装 nfs-utils
包,这里就不详细说明了,网上教程很多,大概就是挂载 DVD 镜像,然后做个本地镜像源,直接 yum install 就可以。
导入镜像包
安装 Rainbond
复制准备节点 Git 克隆的 Helm Chart。
使用 Helm Chart 安装 Rainbond。
- 创建命名空间
- 编写 Helm values.yml,更多 Chart 参数请参阅 Chart 安装选项。
- 执行 Helm 安装命令
安装进度查询
执行完安装命令后,在集群中执行以下命令查看安装状态。
当名称包含 rbd-app-ui
的 Pod 为 Running 状态时即安装成功。
访问平台
复制如下命令,在集群中执行,可以获取到平台访问地址。如果有多个网关节点,则任意一个地址均可访问到控制台。
离线环境源码构建(可选)
如果你需要在离线环境下进行源码构建,请参阅 Rainbond离线源码构建文档进行配置。
最后
通过本文的指导,希望您能顺利完成在鲲鹏ARM和麒麟V10环境下的 Kubernetes 和 Rainbond 的离线部署。在国产化信创环境中,离线部署的需求越来越普遍,我们提供的详细步骤和示例,帮助您减少部署过程中的不确定性和挑战。未来,我们还将继续更新更多相关教程和文档,以更好地服务于国产化信创领域的需求。