2.2. 在 OpenShift 4.x 服务器上安装 Fuse 镜像流和模板
OpenShift Container Platform 4.x 使用 Samples Operator,它在 OpenShift 命名空间中操作,用于安装和更新基于 Red Hat Enterprise Linux (RHEL)的 OpenShift Container Platform 镜像流和模板。在 OpenShift 镜像流和模板上安装 Fuse:
- 重新配置 Samples Operator
将 Fuse 镜像流和模板添加到
Skipped Imagestreams 和 Skipped Templates
字段中。- 跳过的 Imagestreams:位于 Samples Operator 清单中的 Imagestreams,但集群管理员希望 Operator 忽略或不管理。
- 跳过的模板:在 Samples Operator 清单中,但集群管理员希望 Operator 忽略或不管理的模板。
先决条件
- 您可以访问 OpenShift 服务器。
- 您已为 Red Hat Container Registry 配置身份验证。
- 另外,如果在安装 Fuse 模板后在 OpenShift 仪表板中可见,您必须首先安装服务目录和模板服务代理,如 OpenShift 文档(https://docs.openshift.com/container-platform/4.1/applications/service_brokers/installing-service-catalog.html)所述。
流程
- 启动 OpenShift 4 服务器。
以管理员身份登录 OpenShift 服务器。
oc login -u system:admin
oc login -u system:admin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 验证您是否使用创建了 docker-registry secret 的项目。
oc project openshift
oc project openshift
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 查看 Samples operator 的当前配置。
oc get configs.samples.operator.openshift.io -n openshift-cluster-samples-operator -o yaml
oc get configs.samples.operator.openshift.io -n openshift-cluster-samples-operator -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置 Samples operator 以忽略添加的 fuse 模板和镜像流。
oc edit configs.samples.operator.openshift.io -n openshift-cluster-samples-operator
oc edit configs.samples.operator.openshift.io -n openshift-cluster-samples-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 添加 Fuse imagestreams Skipped Imagestreams 部分,并将 Fuse 和 Spring Boot 2 模板添加到 Skipped Templates 部分。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 OpenShift 镜像流上安装 Fuse。
BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-780019-redhat-00005 oc create -n openshift -f ${BASEURL}/fis-image-streams.json
BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-780019-redhat-00005 oc create -n openshift -f ${BASEURL}/fis-image-streams.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果显示错误,显示消息 "Error from server (AlreadyExists): imagestreams.image.openshift.io <imagestreamname> already exists",使用以下命令将现有镜像流替换为最新的镜像流。
oc replace --force -n openshift -f ${BASEURL}/fis-image-streams.json
oc replace --force -n openshift -f ${BASEURL}/fis-image-streams.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 OpenShift quickstart 模板上安装 Fuse:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 安装 Spring Boot 2 quickstart 模板:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow (可选) 查看 OpenShift 模板上安装的 Fuse:
oc get template -n openshift
oc get template -n openshift
Copy to Clipboard Copied! Toggle word wrap Toggle overflow