使用物理介质在气隙环境中安装
堡垒服务器不存在(无法使用物理介质进行外部互联网访问)时,集群管理员可以在气隙环境中安装 WebSphere Automation。
关于本任务
cloudctl 实用程序将 WebSphere Automation 部署到气郄环境的原始方法。 有关使用 ibm-pak 插件的最新方法,请参阅通过将镜像安装到私有容器注册表(使用 ibm-pak 插件)。过程
收集工件
在可访问公共互联网的系统上,收集气隙安装所需的全部必需文件。 这些步骤包括启动本地 Docker 注册表、将产品映像复制到该注册表,以及创建注册表内容的归档。
- 获取 cloudctl 工具。
遵循 https://www.ibm.com/docs/en/ws-automation?topic=installing-in-air-gap-environment 中的步骤 1。
- 下载 Container Application Software for Enterprises (CASE)。
遵循 https://www.ibm.com/docs/en/ws-automation?topic=installing-in-air-gap-environment 中的步骤 2。
- 创建本地 Docker 注册表。
首先,导出 CASEPATH 变量。
export CASEPATH=absolute_path_to_downloaded_ibm-websphere-automation创建本地 Docker 注册表。 注册表内容将存储在
/tmp/docker-registry/路径下。cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action initRegistry \ --args "--user admin --pass admin --registry localhost" - 启动本地 Docker 注册表。
cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action startRegistry - 请验证您是否可以登录本地 Docker 注册表。
如果您正在使用
podman,请使用以下命令进行登录。podman login --tls-verify=false -u admin -p admin localhost:5000如果使用
docker,请按照不安全注册表步骤配置客户端连接到本地注册表。 配置后,使用以下命令进行登录。
docker login -u admin -p admin localhost:5000 - 为本地 Docker 注册表创建凭证。
cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action configure-creds-airgap \ --args "--registry localhost:5000 --user admin --pass admin" - 为 IBM 权利注册表创建凭证。
请遵循 https://www.ibm.com/docs/en/ws-automation?topic=installing-in-air-gap-environment 中的步骤 7。
- 制作映像的镜像。
此步骤类似于 https://www.ibm.com/docs/en/ws-automation?topic=installing-in-air-gap-environment 中的步骤 8。
cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action mirror-images \ --args "--registry localhost:5000 --inputDir ./ibm-websphere-automation" - 创建注册表内容的归档文件。
创建
/tmp/docker-registry目录内容的归档文件。 例如,tar cfz docker-registry.tar.gz -C /tmp/ docker-registry - 创建 CASE 元数据的归档文件。创建步骤 2 中由
cloudctl case save命令创建的ibm-websphere-automation目录内容的归档。 例如,tar cfz ibm-websphere-automation.tar.gz ./ibm-websphere-automation - 导出注册表容器映像。
docker save docker.io/library/registry:2.8 | gzip > registry_image.tar.gz - 通过使用 USB 驱动器或其他物理介质,将所有归档复制到气隙环境中。
在气隙环境中安装 WebSphere Automation
在气隙环境中,提取两个归档的内容,并完成安装过程。 继续之前,请确保 Red Hat®
OpenShift® 集群配置了单独的容器注册表(例如,Artifactory),并且安装了 Red Hat
OpenShift 客户机 (oc) 和 skopeo 1.0.0 或更高版本。
- 解压 Docker 注册表归档 (
docker-registry.tar.gz)。例如,tar xfz docker-registry.tar.gz -C /tmp/。 确保将内容抽取到/tmp/docker-registry目录中。 - 解压
ibm-websphere-automation归档文件。 确保已创建ibm-websphere-automation目录。 - 导入注册表容器映像 (
registry_image.tar.gz)。docker load -i registry_image.tar.gz验证导入的映像是否已使用
docker.io/library/registry:<IMAGE-VERSION-TAG>进行标记。 - 启动本地 Docker 注册表。
首先,导出 CASEPATH 变量。
export CASEPATH=absolute_path_to_downloaded_ibm-websphere-automationcloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action startRegistry --args "--image docker.io/library/registry:2.8" - 验证您能否登录本地 Docker 注册表。
如果您正在使用
podman,请使用以下命令进行登录。podman login --tls-verify=false -u admin -p admin localhost:5000如果使用
docker,请按照不安全注册表步骤配置客户端连接到本地注册表。 配置后,使用以下命令进行登录。
docker login -u admin -p admin localhost:5000 - 为本地 Docker 注册表创建凭证。
cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action configure-creds-airgap \ --args "--registry localhost:5000 --user admin --pass admin" - 设置要与 Red Hat
OpenShift 集群配合使用的容器注册表的 MIRROR_REGISTRY、MIRROR_REGISTRY_USERNAME 和 MIRROR_REGISTRY_PASSWORD 属性。
export MIRROR_REGISTRY=registry export MIRROR_REGISTRY_USERNAME=username export MIRROR_REGISTRY_PASSWORD=password - 创建容器注册表的凭证以与 Red Hat
OpenShift 集群配合使用。
cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action configure-creds-airgap \ --args "--registry $MIRROR_REGISTRY --user $MIRROR_REGISTRY_USERNAME --pass $MIRROR_REGISTRY_PASSWORD" - 将映像从本地注册表复制到
myRegistry。cloudctl case launch \ --case $CASEPATH \ --inventory automationOperatorSetup \ --action mirror-images \ --args "--registry $MIRROR_REGISTRY --inputDir ./ibm-websphere-automation --fromRegistry localhost:5000"如果未安装必备软件(
oc和skopeo1.0.0 或更高版本),那么此步骤将失败。 此外,此过程可能需要很长时间,并且有时可能由于网络错误或其他间歇性问题而失败。 重新运行此命令,直到成功复制所有映像为止。 - 配置
ImageContentSourcePolicy并创建全局拉取私钥。首先,导出以下变量:
export OFFLINEDIR=absolute_path_to_outputdir_from_previous_cloudctl_case_save然后,执行 https://www.ibm.com/docs/en/ws-automation?topic=installing-in-air-gap-environment 中的步骤 9。
- 如果使用非安全镜像注册表,请配置非安全注册表。
请配置集群,以允许从该注册表拉取映像。 将以下命令中的单词
registry替换为您的注册表名称,然后运行patch命令。oc patch image.config.openshift.io/cluster --type=merge -p '{"spec":{"registrySources":{"insecureRegistries":["registry"]}}}'提示: 在每个节点耗尽其 pod 时,为不安全的注册表配置修补集群需要几分钟时间。 转至下一步之前,请确保所有节点的状态都为Ready。 请运行oc get nodes命令以获取状态。 - 等待转出过程完成。
运行以下命令以验证 Updated 状态是否设置为
true。oc get machineconfigpools - 安装 WebSphere Automation 操作程序。
cloudctl case launch \ --case $CASEPATH \ --namespace $WSA_OPERATOR_NAMESPACE \ --inventory automationOperatorSetup \ --action install-operator \ --args "--inputDir $OFFLINEDIR" - 创建 WebSphere Automation 的实例。
下一步操作
如果需要,请更改缺省密码。 有关更多信息,请参阅 更改集群管理员访问凭证。