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

注記

Fuse 7.10 では、Fuse on OpenShift イメージストリームおよびテンプレートを IBM Power Systems、IBM Z、および LinuxONE へインストールすることは、サポートされていません。Fuse on OpenShift Operator でインストールできるコンポーネントのみが IBM Power Systems、IBM Z、および LinuxONE でサポートされます。

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 サーバーにアクセスできる必要があります。
  • registry.redhat.io への認証が設定されている。
  • オプションで、インストール後に、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 --user system:admin --token=my-token --server=https://my-cluster.example.com:6443
  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:
      - 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-fuse710-eap-camel-amq
      - s2i-fuse710-eap-camel-cdi
      - s2i-fuse710-eap-camel-cxf-jaxrs
      - s2i-fuse710-eap-camel-cxf-jaxws
      - s2i-fuse710-karaf-camel-amq
      - s2i-fuse710-karaf-camel-log
      - s2i-fuse710-karaf-camel-rest-sql
      - s2i-fuse710-karaf-cxf-rest
      - s2i-fuse710-spring-boot-2-camel-amq
      - s2i-fuse710-spring-boot-2-camel-config
      - s2i-fuse710-spring-boot-2-camel-drools
      - s2i-fuse710-spring-boot-2-camel-infinispan
      - s2i-fuse710-spring-boot-2-camel-rest-3scale
      - s2i-fuse710-spring-boot-2-camel-rest-sql
      - s2i-fuse710-spring-boot-2-camel
      - s2i-fuse710-spring-boot-2-camel-xa
      - s2i-fuse710-spring-boot-2-camel-xml
      - s2i-fuse710-spring-boot-2-cxf-jaxrs
      - s2i-fuse710-spring-boot-2-cxf-jaxws
      - s2i-fuse710-spring-boot-2-cxf-jaxrs-xml
      - s2i-fuse710-spring-boot-2-cxf-jaxws-xml
  7. Fuse on OpenShift イメージストリームをインストールします。

    1. BASEURL 変数をイメージストリームの場所に設定します。

      Fuse 7.10.1 の場合

      BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-7_10_1-00010-redhat-00001

      Fuse 7.10.0 の場合

      BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-sb2-7_10_0-00015-redhat-00001
    2. イメージストリームをインストールするコマンドを実行します。

      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-7_10_0-00015-redhat-00001/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-7_10_0-00015-redhat-00001/quickstarts/${template}
     done
  10. (任意手順) インストールされた Fuse on OpenShift テンプレートを表示します。

    oc get template -n openshift