2.5. 在 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 服务器。
-
您已将身份验证配置为
registry.redhat.io
。
步骤
- 启动 OpenShift 4 服务器。
以管理员身份登录 OpenShift 服务器。
oc login --user system:admin --token=my-token --server=https://my-cluster.example.com:6443
验证您是否使用您为其创建 docker-registry secret 的项目。
oc project openshift
查看 Samples operator 的当前配置。
oc get configs.samples.operator.openshift.io -n openshift-cluster-samples-operator -o yaml
配置 Samples operator 以忽略添加的 fuse 模板和镜像流。
oc edit configs.samples.operator.openshift.io -n openshift-cluster-samples-operator
添加 Fuse imagestreams Skipped Imagestreams 部分,并将 Fuse 和 Spring Boot 2 模板添加到 Skipped Templates 部分。
[...] spec: architectures: - x86_64 managementState: Managed skippedImagestreams: - fuse-console-rhel8 - fuse-eap-openshift-jdk8-rhel7 - fuse-eap-openshift-jdk11-rhel8 - fuse-java-openshift-rhel8 - fuse-java-openshift-jdk11-rhel8 - fuse-karaf-openshift-rhel8 - fuse-karaf-openshift-jdk11-rhel8 - fuse-apicurito-generator-rhel8 - fuse-apicurito-rhel8 skippedTemplates: - s2i-fuse712-eap-camel-amq - s2i-fuse712-eap-camel-cdi - s2i-fuse712-eap-camel-cxf-jaxrs - s2i-fuse712-eap-camel-cxf-jaxws - s2i-fuse712-karaf-camel-amq - s2i-fuse712-karaf-camel-log - s2i-fuse712-karaf-camel-rest-sql - s2i-fuse712-karaf-cxf-rest - s2i-fuse712-spring-boot-2-camel-amq - s2i-fuse712-spring-boot-2-camel-config - s2i-fuse712-spring-boot-2-camel-drools - s2i-fuse712-spring-boot-2-camel-infinispan - s2i-fuse712-spring-boot-2-camel-rest-3scale - s2i-fuse712-spring-boot-2-camel-rest-sql - s2i-fuse712-spring-boot-2-camel - s2i-fuse712-spring-boot-2-camel-xa - s2i-fuse712-spring-boot-2-camel-xml - s2i-fuse712-spring-boot-2-cxf-jaxrs - s2i-fuse712-spring-boot-2-cxf-jaxws - s2i-fuse712-spring-boot-2-cxf-jaxrs-xml - s2i-fuse712-spring-boot-2-cxf-jaxws-xml
在 OpenShift 镜像流上升级 Fuse。
BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-7_12_1-00011-redhat-00001 oc replace -n openshift -f ${BASEURL}/fis-image-streams.json
在 OpenShift 快速启动模板上升级 Fuse:
for template in eap-camel-amq-template.json \ eap-camel-cdi-template.json \ eap-camel-cxf-jaxrs-template.json \ eap-camel-cxf-jaxws-template.json \ karaf-camel-amq-template.json \ karaf-camel-log-template.json \ karaf-camel-rest-sql-template.json \ karaf-cxf-rest-template.json ; do oc replace -n openshift \ ${BASEURL}/quickstarts/${template} done
升级 Spring Boot 2 快速启动模板:
for template in spring-boot-2-camel-amq-template.json \ spring-boot-2-camel-config-template.json \ spring-boot-2-camel-drools-template.json \ spring-boot-2-camel-infinispan-template.json \ spring-boot-2-camel-rest-3scale-template.json \ spring-boot-2-camel-rest-sql-template.json \ spring-boot-2-camel-template.json \ spring-boot-2-camel-xa-template.json \ spring-boot-2-camel-xml-template.json \ spring-boot-2-cxf-jaxrs-template.json \ spring-boot-2-cxf-jaxws-template.json \ spring-boot-2-cxf-jaxrs-xml-template.json \ spring-boot-2-cxf-jaxws-xml-template.json ; do oc replace -n openshift \ ${BASEURL}/quickstarts/${template} done
(可选) 查看 OpenShift 模板上的升级 Fuse:
oc get template -n openshift