第2章 OpenShift 環境に Red Hat Decision Manager をデプロイする準備
OpenShift 環境に Red Hat Decision Manager をデプロイする前に、準備タスクをいくつか完了する必要があります。追加イメージ (たとえば、デシジョンサービスの新しいバージョン、または別のデシジョンサービス) をデプロイする場合は、このタスクを繰り返す必要はありません。
前提条件
- OpenShift 環境で 4 ギガバイト以上のメモリーが利用可能であることを確認します。
- デプロイメント用の OpenShift プロジェクトを作成します。
-
OpenShift web コンソールと
oc
コマンドを使用してプロジェクトにログインします。
2.1. イメージストリームが利用可能であることを確認
You must ensure that the image streams that are required for the deployment are available in your OpenShift environment. Some versions of the OpenShift environment include the necessary image streams. You must check if they are available. If they are not available, you must install the rhdm70-image-streams.yaml
file.
手順
以下のコマンドを実行します。
oc get imagestreamtag -n openshift | grep rhdm70-decisioncentral-openshift oc get imagestreamtag -n openshift | grep rhdm70-kieserver-openshift
$ oc get imagestreamtag -n openshift | grep rhdm70-decisioncentral-openshift $ oc get imagestreamtag -n openshift | grep rhdm70-kieserver-openshift
Copy to Clipboard Copied! 両コマンドの出力が空でない場合は、必要なイメージストリームが利用できるため、これ以外の操作は必要ありません。
If the output of one or both of the commands is empty, download the
rhdm-7.0.1-openshift-templates.zip
product deliverable file from the Software Downloads page for Red Hat Decision Manager 7.0. Extract therhdm70-image-streams.yaml
file from it. Complete one of the following actions:以下のコマンドを実行します。
oc create -f rhdm70-image-streams.yaml
$ oc create -f rhdm70-image-streams.yaml
Copy to Clipboard Copied! -
Using the OpenShift Web UI, select Add to Project
Import YAML / JSON, then choose the file or paste its contents.
2.2. Decision Server にシークレットの作成
OpenShift は、シークレット
と呼ばれるオブジェクトを使用してパスワードやキーストアなどの機密情報を保持します。詳細は、OpenShift ドキュメントの「Secrets」の章を参照してください。
Decision Server に SSL 証明書を作成し、それをシークレットとして OpenShift 環境に提供します。
HTTPS に対応しない S2I (source to image) を使用して Decision Server をデプロイする場合は、シークレットオブジェクトを作成する必要がありません。
手順
Decision Server の SSL 暗号化の秘密鍵および公開鍵を使用して SSL キーストアを生成します。プロダクション環境で、期待する Decision Server の URL に一致する有効な署名付き証明書を生成します。キーストアを
keystore.jks
ファイルに保存します。証明書の名前と、キーストアファイルのパスワードを記録します。自己署名型または購入する SSL 証明書を使用してキーストアを作成する方法は「Generate a SSL Encryption Key and Certificate」を参照してください。
oc
コマンドを使用して、新しいキーストアファイルからシークレットkieserver-app-secret
を生成します。oc create secret generic kieserver-app-secret --from-file=keystore.jks
$ oc create secret generic kieserver-app-secret --from-file=keystore.jks
Copy to Clipboard Copied! サービスアカウント
kieserver-service-account
を作成します。oc create serviceaccount kieserver-service-account
$ oc create serviceaccount kieserver-service-account
Copy to Clipboard Copied! シークレットをサービスアカウントに追加します。
oc secret add sa/kieserver-service-account secret/kieserver-app-secret
$ oc secret add sa/kieserver-service-account secret/kieserver-app-secret
Copy to Clipboard Copied!
2.3. Decision Central へのシークレットの作成
OpenShift 環境に Decision Central をデプロイする場合は、Decision Central に SSL 証明書を作成し、OpenShift 環境にシークレットとして提供します。Decision Central と Decision Server には、同じ証明書とキーストアを使用しないでください。
手順
Decision Central の SSL 暗号化の秘密鍵および公開鍵を使用して、SSL キーストアを生成します。プロダクション環境で、期待する Decision Central の URL に一致する有効な署名付き証明書を生成します。キーストアを
keystore.jks
ファイルに保存します。証明書の名前と、キーストアファイルのパスワードを登録します。自己署名型または購入する SSL 証明書を使用してキーストアを作成する方法は「Generate a SSL Encryption Key and Certificate」を参照してください。
oc
コマンドを使用して、新しいキーストアファイルからシークレットdecisioncentral-app-secret
を生成します。oc create secret generic decisioncentral-app-secret --from-file=keystore.jks
$ oc create secret generic decisioncentral-app-secret --from-file=keystore.jks
Copy to Clipboard Copied! サービスアカウント
decisioncentral-service-account
を作成します。oc create serviceaccount decisioncentral-service-account
$ oc create serviceaccount decisioncentral-service-account
Copy to Clipboard Copied! シークレットをサービスアカウントに追加します。
oc secret add sa/decisioncentral-service-account secret/decisioncentral-app-secret
$ oc secret add sa/decisioncentral-service-account secret/decisioncentral-app-secret
Copy to Clipboard Copied!