# OpehShiftにDynamic Engineをデプロイ

OpehShiftクラスターの準備ができたら、イメージレジストリーを設定(必要に応じて)、セキュリティコンテキスト制約を設定し、Dynamic Engineおよび環境をデプロイします。

## 始める前に

* Dynamic Engineデプロイメント向けに設定されたOpenShiftクラスター。プラットフォーム固有の前提条件、サポートされたバージョン、クラスターへのアクセス手順については、[Dynamic Engineデプロイメント向けのOpenShift (OKD)の設定](https://help.qlik.com/talend/ja-JP/dynamic-engine-configuration-guide/Cloud/deploying-dynamic-engine-on-openshift "Dynamic Engineは、OpenShift (OKD)クラスターにデプロイします。")を参照してください。
* Dynamic Engineとその環境向けにTalend Management Consoleによって生成されたHelm値ファイル。[デフォルトのHelmデプロイメント](https://help.qlik.com/talend/ja-JP/dynamic-engine-configuration-guide/Cloud/deploy-with-helm-values-files "Helmチャートでは、カスタムのネームスペース、サービス名、ストレージ設定でDynamic Engineをデプロイできます。")をご覧ください。
* dynamic-engine-crdカスタムリソース定義は、oci://ghcr.io/talend/helm/dynamic-engine-crd Helmチャートを使用してインストールされている必要があります。インストールされていない場合は、次のコマンドを実行してインストールしてください。
  1. 使用するチャートのバージョンを見つけます。

     * 次のHelmコマンドを実行します:
       ```
       helm show chart oci://ghcr.io/talend/helm/dynamic-engine-crd --version <engine_version>
       ```
     * Talend Management Consoleから直接バージョンを見るか、自分のDynamic Engineバージョンに含まれているチャートバージョンの[Dynamic Engine変更ログ](https://help.qlik.com/talend/en-US/dynamic-engine-changelog/Cloud)をチェックしてください。
     * [Dynamic Engineバージョンエンドポイント](https://talend.qlik.dev/apis/dynamic-engine/2021-03/#operation_return-all-supported-dynamic-engine-versions)へのAPIコールを使用します。

  2. 次のコマンドを実行し、目的のバージョンのHelmチャートをインストールします。

     ```
     helm install dynamic-engine-crd oci://ghcr.io/talend/helm/dynamic-engine-crd --version <helm_chart_version>
     ```

     &lt;helm\_chart\_version&gt;を、お使いのDynamic Engineバージョンでサポートされているチャートのバージョンに置換します。

     バージョンを指定しないと、利用可能な最新のdynamic-engine-crdチャートバージョンがインストールされます。

## このタスクについて

情報メモ重要: If you deploy with global.profile: standard and do not provide a security context constraint, the deployment fails with the message Only minimal profile is supported in an OpenShift cluster if no securityContextConstraint is provided. Either set global.profile: minimal, or provide configuration.security.securityContextConstraint as described in step 2.

この手順では、Talend Management Consoleによって生成された値ファイルの上に、OpehShift固有の値を追加します。

## 手順

1. 組み込みイメージレジストリーを無効化するDynamic EngineのOpehShift固有の値を作成します。
   ```
   ---
   global:
     profile: minimal
   docker-registry:
     enabled: false
   ```

   組み込みのdocker-registryサービスは、OpehShiftクラスターでの本番使用には適していません。

   情報メモヒント: To pull Dynamic Engine's own service images through a private registry proxy instead of directly from ghcr.io/talend, configure global.registry.dockerRegistry as described in [Dynamic Engineのデプロイメントにプライベートイメージレジストリを使用する](https://help.qlik.com/talend/ja-JP/dynamic-engine-configuration-guide/Cloud/deploy-dynamic-engine-using-private-image-registry "Dynamic Engineがデプロイメントにプライベートイメージレジストリを使用するように設定します。"). This is separate from configuration.registry, which points to the registry for your own Data Integration and Data Services/Routes images, as described in the following step.
2. イメージレジストリーをポイントするDynamic Engine環境に対してOpehShift固有の値を作成します。

   minimalプロファイルを使って:
   ```
   ---
   global:
     profile: minimal
   configuration:
     registry:
       url: <your-registry-url>
       secretName: <your-registry-secret>
   ```

   standardプロファイルを使って、非ルートユーザーIDを許可するセキュリティコンテキスト制約を追加します:
   ```
   ---
   global:
     profile: standard
   configuration:
     registry:
       url: <your-registry-url>
       secretName: <your-registry-secret>
     security:
       securityContextConstraint: nonroot-v2
   ```

   情報メモヒント: You can set dedicated constraints for data integration Jobs and for Data Services and Routes with configuration.jobDeployment.securityContextConstraint and configuration.dataServiceRouteDeployment.securityContextConstraint. If these are not set, the value of configuration.security.securityContextConstraint applies.

   情報メモ注: The Dynamic Engine itself does not require this constraint, because its operator service account already has access to a more permissive constraint.
3. 両方の値のファイルに、Dynamic Engineインスタンスとその環境をデプロイします。
   ```
   helm upgrade --install dynamic-engine-$DYNAMIC_ENGINE_ID \
    -f $DYNAMIC_ENGINE_ID-values.yaml \
    -f $DYNAMIC_ENGINE_ID-custom-openshift-values.yaml \
    oci://ghcr.io/talend/helm/dynamic-engine \
    --version $DYNAMIC_ENGINE_VERSION

   helm upgrade --install dynamic-engine-environment-$DYNAMIC_ENGINE_ENVIRONMENT_ID \
    -f $DYNAMIC_ENGINE_ENVIRONMENT_ID-values.yaml \
    -f $DYNAMIC_ENGINE_ENVIRONMENT_ID-custom-openshift-values.yaml \
    oci://ghcr.io/talend/helm/dynamic-engine-environment \
    --version $DYNAMIC_ENGINE_VERSION
   ```
4. オプション: タスクで永続的ストレージが必要な場合、ReadWriteManyストレージクラスを設定します。

   [Dynamic Engine環境サービス専用のストレージクラスをプロビジョニング](https://help.qlik.com/talend/ja-JP/dynamic-engine-configuration-guide/Cloud/deploy-dynamic-engine-with-specific-storageclass "デフォルトのKubernetesストレージクラスを使用する代わりに、Dynamic Engine環境サービス専用のストレージクラスを設定します。")をご覧ください。

## タスクの結果

Dynamic Engineとその環境は、OpehShiftクラスターにデプロイされます。ポッドステータスを検証します:

```
oc get pods -n <your-namespace>
```

Talend Management Consoleではこの環境のステータスが[Ready] (準備完了)になり、タスクまたはプランを実行する準備ができていることが確定されます。

デプロイメントに失敗するか、Dynamic Engineサービスの関連付けが解除されると、ステータスは「まだ準備できていません」になります。

## 次のタスク

デプロイメントが成功したら、標準エンジンの場合と同様に、Dynamic Engine環境にタスクを追加できます。詳細は、[Dynamic Engine環境にジョブタスクを追加](https://help.qlik.com/talend/ja-JP/dynamic-engine-configuration-guide/Cloud/adding-task-in-dynamic-engine-environment "ジョブタスクとは、Talend Studioから公開されたジョブアーティファクトを含んでいる実行可能な統合プロセスのことです。")をご覧ください。