2.2. OpenShift 4.x サーバーでの Fuse イメージストリームおよびテンプレートのインストール

OpenShift Container Platform 4.x は、OpenShift namespace で操作する Samples Operator を使用して、Red Hat Enterprise Linux (RHEL) ベースの OpenShift Container Platform イメージストリームおよびテンプレートをインストールおよび更新します。Fuse on OpenShift イメージストリームおよびテンプレートをインストールするには、以下を行います。

  • Samples Operator の再設定
  • Fuse イメージストリームおよびテンプレートを Skipped Imagestreams and Skipped Templates フィールドに追加します。

    • Skipped Imagestreams (スキップされるイメージストリーム): Samples Operator のインベントリーにあるが、クラスター管理者の希望により Operator が無視または管理しないようにするイメージストリーム。
    • Skipped Templates (スキップされるテンプレート): Samples Operator のインベントリーにあるが、クラスター管理者の希望により Operator が無視または管理しないようにするテンプレート。

前提条件

  • OpenShift サーバーにアクセスできる必要があります。
  • Red Hat コンテナーレジストリーへの認証が設定されている必要があります。
  • オプションで、インストール後に、OpenShift ダッシュボードに Fuse テンプレートを表示させる場合には、OpenShift ドキュメント (https://docs.openshift.com/container-platform/4.1/applications/service_brokers/installing-service-catalog.html) に記載されているように、サービスカタログとテンプレートサービスブローカーを先にインストールする必要があります。

手順

  1. OpenShift 4 サーバーを起動します。
  2. OpenShift サーバーに管理者としてログインします。

    oc login -u system:admin
  3. docker-registry シークレットを作成したプロジェクトを使用していることを確認します。

    oc project openshift
  4. Samples Operator の現在の設定を表示します。

    oc get configs.samples.operator.openshift.io -n openshift-cluster-samples-operator -o yaml
  5. Samples Operator が、追加された Fuse テンプレートおよびイメージストリームを無視するよう設定します。

    oc edit configs.samples.operator.openshift.io -n openshift-cluster-samples-operator
  6. Fuse imagestreams の Skipped Imagestreams セクションを追加し、Fuse および Spring Boot 2 のテンプレートを Skipped Templates セクションに追加します。

    [...]
    spec:
      architectures:
      - x86_64
      managementState: Managed
      skippedImagestreams:
      - fis-java-openshift
      - fis-karaf-openshift
      - fuse7-console
      - fuse7-eap-openshift
      - fuse7-java-openshift
      - fuse7-karaf-openshift
      - jboss-fuse70-console
      - jboss-fuse70-eap-openshift
      - jboss-fuse70-java-openshift
      - jboss-fuse70-karaf-openshift
      - fuse-apicurito-generator
      - apicurito-ui
      skippedTemplates:
      - s2i-fuse78-eap-camel-amq
      - s2i-fuse78-eap-camel-cdi
      - s2i-fuse78-eap-camel-cxf-jaxrs
      - s2i-fuse78-eap-camel-cxf-jaxws
      - s2i-fuse78-karaf-camel-amq
      - s2i-fuse78-karaf-camel-log
      - s2i-fuse78-karaf-camel-rest-sql
      - s2i-fuse78-karaf-cxf-rest
      - s2i-fuse78-spring-boot-2-camel-amq
      - s2i-fuse78-spring-boot-2-camel-config
      - s2i-fuse78-spring-boot-2-camel-drools
      - s2i-fuse78-spring-boot-2-camel-infinispan
      - s2i-fuse78-spring-boot-2-camel-rest-3scale
      - s2i-fuse78-spring-boot-2-camel-rest-sql
      - s2i-fuse78-spring-boot-2-camel
      - s2i-fuse78-spring-boot-2-camel-xa
      - s2i-fuse78-spring-boot-2-camel-xml
      - s2i-fuse78-spring-boot-2-cxf-jaxrs
      - s2i-fuse78-spring-boot-2-cxf-jaxws
      - s2i-fuse78-spring-boot-2-cxf-jaxrs-xml
      - s2i-fuse78-spring-boot-2-cxf-jaxws-xml
  7. Fuse on OpenShift イメージストリームをインストールします。

    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
    注記

    Error from server (AlreadyExists): imagestreams.image.openshift.io <imagestreamname> already exists というメッセージでエラーが表示された場合、以下のコマンドを使用して、既存のイメージストリームを最新のものに置き換えます。

    oc replace --force -n openshift -f ${BASEURL}/fis-image-streams.json
  8. Fuse on OpenShift のクイックスタートテンプレートをインストールします。

    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 create -n openshift -f \
     https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-780019-redhat-00005/quickstarts/${template}
     done
  9. 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 create -n openshift -f \
     https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-780019-redhat-00005/quickstarts/${template}
     done
  10. (任意手順) インストールされた Fuse on OpenShift テンプレートを表示します。

    oc get template -n openshift