10.3. カスタムイメージビルドおよび OpenShift Web コンソールを使用した Red Hat build of Kogito マイクロサービスの OpenShift へのデプロイ


OpenShift で Red Hat build of Kogito マイクロサービスをビルドし、デプロイする代わりに、カスタムイメージビルドを使用できます。

Operator は以下のカスタムリソースを使用して、開発するマイクロサービス (ドメイン固有のマイクロサービス) をデプロイします。

  • KogitoRuntime はランタイムイメージを起動し、要件に応じて設定します。
注記

Red Hat Decision Manager ビルダーイメージはネイティブビルドをサポートしません。ただし、以下の例のように、カスタムビルドを実行し、Containerfile を使用してコンテナーイメージをビルドできます。

FROM registry.redhat.io/rhpam-7-tech-preview/rhpam-kogito-runtime-native-rhel8:7.13.4

ENV RUNTIME_TYPE quarkus

COPY --chown=1001:root target/*-runner $KOGITO_HOME/bin

この機能はテクノロジープレビューとしてのみ提供されています。

Mandrel を使用してネイティブバイナリーをビルドするには、Quarkus アプリケーションのネイティブ実行可能ファイルへのコンパイル を参照してください。

前提条件

  • RHPAM Kogito Operator がインストールされている。
  • OpenShift Web コンソールにアクセスでき、KogitoRuntime の作成および編集に必要なパーミッションが設定されている。
  • (Red Hat build of Quarkus のみ) プロジェクトの pom.xml ファイルに quarkus-smallrye-health 拡張機能の依存関係が含まれる。この拡張機能は、OpenShift の Red Hat build of Quarkus プロジェクトに必要な Liveness および Readiness Probe を有効にします。

    OpenShift 上の Red Hat build of Quarkus アプリケーションの SmallRye Health 依存関係

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap

手順

  1. アプリケーションをローカルに構築します。
  2. 以下の内容を含むプロジェクトルートディレクトリーに Containerfile を作成します。

    Red Hat build of Quarkus アプリケーションの Containerfile の例

    FROM registry.redhat.io/rhpam-7/rhpam-kogito-runtime-jvm-rhel8:7.13.4
    
    ENV RUNTIME_TYPE quarkus
    
    COPY target/quarkus-app/lib/ $KOGITO_HOME/bin/lib/
    COPY target/quarkus-app/*.jar $KOGITO_HOME/bin
    COPY target/quarkus-app/app/ $KOGITO_HOME/bin/app/
    COPY target/quarkus-app/quarkus/ $KOGITO_HOME/bin/quarkus/
    Copy to Clipboard Toggle word wrap

    Spring Boot アプリケーションの Containerfile の例

    FROM registry.redhat.io/rhpam-7/rhpam-kogito-runtime-jvm-rhel8:7.13.4
    
    ENV RUNTIME_TYPE springboot
    
    COPY target/<application-jar-file> $KOGITO_HOME/bin
    Copy to Clipboard Toggle word wrap

    • application-jar-file は、アプリケーションの JAR ファイルの名前です。
  3. 以下のコマンドを使用して Red Hat build of Kogito イメージをビルドします。

    podman build --tag <final-image-name> -f <Container-file>
    Copy to Clipboard Toggle word wrap

    このコマンドでは、final-image-name は Red Hat build of Kogito イメージの名前、Container-file は直前の手順で作成した Containerfile に置き換えます。

  4. 必要に応じて、以下のコマンドを使用してビルドイメージをテストします。

    podman run --rm -it -p 8080:8080 <final-image-name>
    Copy to Clipboard Toggle word wrap
  5. 以下のコマンドを使用して、ビルドした Red Hat build of Kogito イメージをイメージレジストリーにプッシュします。

    podman push <final-image-name>
    Copy to Clipboard Toggle word wrap
  6. Operators Installed Operators に移動し、RHPAM Kogito Operator を選択します。
  7. Red Hat build of Kogito マイクロサービス定義を作成するには、Operator ページで Kogito Runtime タブを選択し、Create KogitoRuntime をクリックします。
  8. アプリケーションウィンドウで、Form View または YAML View を使用してマイクロサービス定義を設定します。

    少なくとも、以下の YAML ファイルのサンプルに示されるようにアプリケーション設定を定義します。

    Red Hat build of Kogito マイクロサービスを使用した Red Hat build of Quarkus アプリケーションの YAML 定義の例

    apiVersion: rhpam.kiegroup.org/v1 # Red Hat build of Kogito API for this microservice
    kind: KogitoRuntime # Application type
    metadata:
      name: example-quarkus # Application name
    spec:
      image: <final-image-name> # Kogito image name
      insecureImageRegistry: true # Can be omitted when image is pushed into secured registry with valid certificate
    Copy to Clipboard Toggle word wrap

    Red Hat build of Kogito マイクロサービスを使用した Spring Boot アプリケーションの YAML 定義の例

    apiVersion: rhpam.kiegroup.org/v1 # Red Hat build of Kogito API for this microservice
    kind: KogitoRuntime # Application type
    metadata:
      name: example-springboot # Application name
    spec:
      image: <final-image-name> # Kogito image name
      insecureImageRegistry: true # Can be omitted when image is pushed into secured registry with valid certificate
      runtime: springboot
    Copy to Clipboard Toggle word wrap

  9. アプリケーションデータを定義したら、Create をクリックして Red Hat build of Kogito マイクロサービスを生成します。

    アプリケーションが Red Hat build of Kogito マイクロサービスページに一覧表示されます。アプリケーション名を選択して、アプリケーション設定や YAML ファイルの内容を表示または変更できます。

  10. アプリケーションのビルドが完了したら、Workloads Deployments に移動して、アプリケーションのデプロイメント、Pod のステータスなどの情報を表示します。
  11. Red Hat build of Kogito マイクロサービスをデプロイしたら、Web コンソールの左側のメニューの Networking Routes に移動し、デプロイされたアプリケーションへのアクセスリンクを表示します。

    アプリケーション名を選択して、ルート設定を表示または変更できます。

    必要に応じてアプリケーションルートを使用すると、Red Hat build of Kogito マイクロサービスはビジネス自動化ソリューションと統合できます。

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る