3.2. Red Hat OpenShift Container Platform Web コンソールでの Automation Controller の設定
次の手順を使用すると、Red Hat OpenShift Container Platform で Automation Controller Operator を設定し、カスタムリソースを指定し、外部データベースを使用して Ansible Automation Platform をデプロイできます。
Automation controller の設定は、Automation controller の extra_settings を通じて、またはデプロイメント後にユーザーインターフェイスで直接行うことができます。ただし、extra_settings で行われた設定は、ユーザーインターフェイスで行われた設定よりも優先されることに注意することが重要です。
Automation Controller のインスタンスが削除されても、関連する PVC は自動的に削除されません。これにより、新しいデプロイメントの名前が前のデプロイメントと同じ場合は、移行中に問題が発生する可能性があります。したがって、同じ namespace に新規 Automation Controller インスタンスをデプロイする前に、古い PVC を手動で削除することが推奨されます。詳細は、PVC の検索および削除 を参照してください。
3.2.1. 前提条件
- Operator Hub で Red Hat Ansible Automation Platform カタログをインストールした。
- Automation Controller の場合は、Operator が必要な PVC を動的に作成できるように、クラスターにデフォルトの StorageClass を設定する必要があります。外部 PostgreSQL データベースが設定されている場合、これは必要ありません。
- Hub の場合は、コンテンツ、Redis、および API Pod に必要な PVC を動的に作成できるように、ReadWriteMany をサポートする StorageClass がクラスター上で使用可能である必要があります。クラスター上のデフォルトの StorageClass ではない場合は、AutomationHub オブジェクトの作成時にそれを指定できます。
3.2.1.1. コントローラーイメージのプルポリシーの設定
この手順を使用して、Automation Controller でイメージプルポリシーを設定します。
手順
- Red Hat OpenShift Container Platform にログインします。
-
に移動します。 - Ansible Automation Platform Operator のデプロイメントを選択します。
- Automation Controller タブを選択します。
新しいインスタンスの場合は、
をクリックします。- 既存のインスタンスの場合は、⋮ アイコンをクリックして クリックすると、YAML ビューを編集できます。
Image Pull Policy の下で、ラジオボタンをクリックして選択します。
をクリックします。- Always
- Never
- IfNotPresent
Image Pull Secrets の下にあるオプションを表示するには、矢印をクリックします。
- Add Image Pull Secret の横にある をクリックして、値を入力します。
Web container resource requirements ドロップダウンリストの下にフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
Task container resource requirements ドロップダウンリストの下にフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
EE Control Plane container resource requirements ドロップダウンリストの下にフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
PostgreSQL init container resource requirements (when using a managed service) ドロップダウンリストの下にフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
Redis container resource requirements ドロップダウンリストの下にフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
PostgreSQL container resource requirements (when using a managed instance)* ドロップダウンリストの下のフィールドを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
PostgreSQL container storage requirements (when using a managed instance) ドロップダウンリストを表示するには、矢印をクリックします。
- Limits および Requests で、CPU cores、Memory、および Storage の値を入力します。
- レプリカで、インスタンスレプリカの数を入力します。
- Remove used secrets on instance removal で、true または false を選択します。デフォルトは false です。
- Preload instance with data upon creation で、true または false を選択します。デフォルトは true です。
3.2.1.2. コントローラー LDAP セキュリティーの設定
次のいずれかの方法を使用して、Automation Controller の LDAP SSL 設定を設定できます。
- Automation Controller ユーザーインターフェイス。
- プラットフォームゲートウェイのユーザーインターフェイス。追加の手順は、アクセス管理および認証 ガイドの LDAP 認証の設定 セクションを参照してください。
- 手順は以下のとおりです。
手順
Ansible Automation Platform の namespace に、
bundle-ca.crt
ファイルのシークレットを作成します (ファイル名はbundle-ca.crt
である必要があります)。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create secret -n aap-namespace generic bundle-ca-secret --from-file=bundle-ca.crt
$ oc create secret -n aap-namespace generic bundle-ca-secret --from-file=bundle-ca.crt
お客様の Ansible Automation Platform リソースに
bundle_cacert_secret
を追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ... spec: bundle_cacert_secret: bundle-ca-secret ...
... spec: bundle_cacert_secret: bundle-ca-secret ...
検証
次のコマンドを実行すると、期待どおりの証明書であるかを確認できます。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc exec -it deployment.apps/aap-gateway - openssl x509 -in /etc/pki/tls/certs/bundle-ca.crt -noout -text
oc exec -it deployment.apps/aap-gateway - openssl x509 -in /etc/pki/tls/certs/bundle-ca.crt -noout -text
3.2.1.3. Automation Controller Operator ルートオプションの設定
Red Hat Ansible Automation Platform Operator のインストールフォームを使用すると、Advanced configuration で Automation Controller Operator のルートオプションをさらに設定できます。
手順
- Red Hat OpenShift Container Platform にログインします。
-
に移動します。 - Ansible Automation Platform Operator のデプロイメントを選択します。
- Automation Controller タブを選択します。
新しいインスタンスの場合は、
をクリックします。- 既存のインスタンスの場合は、⋮ アイコンをクリックして クリックすると、YAML ビューを編集できます。
- をクリックします。
- Ingress type でドロップダウンメニューをクリックし、Route を選択します。
- Route DNS host で、ルートの応答先となる共通のホスト名を入力します。
- Route TLS termination mechanism ドロップダウンメニューをクリックし、Edge または Passthrough を選択します。ほとんどの場合は、Edge を選択する必要があります。
- Route TLS credential secret で、ドロップダウンメニューをクリックし、一覧からシークレットを選択します。
- /var/lib/projects ディレクトリーで永続性を有効にする で、スライダーを動かして true または false を選択します。
3.2.1.4. Automation Controller Operator の Ingress タイプの設定
Ansible Automation Platform Operator のインストールフォームを使用すると、Advanced configuration で Automation Controller Operator の Ingress をさらに設定できます。
手順
- Red Hat OpenShift Container Platform にログインします。
-
に移動します。 - Ansible Automation Platform Operator のデプロイメントを選択します。
- Automation Controller タブを選択します。
新しいインスタンスの場合は、
をクリックします。- 既存のインスタンスの場合は、⋮ アイコンをクリックして クリックすると、YAML ビューを編集できます。
- をクリックします。
- Ingress type でドロップダウンメニューをクリックし、Ingress を選択します。
- Ingress annotations で、Ingress に追加するアノテーションを入力します。
- Ingress TLS secret でドロップダウンメニューをクリックし、一覧からシークレットを選択します。
Automation Controller Operator を設定したら、フォームビューの下部にある
をクリックします。Red Hat OpenShift Container Platform が Pod を作成します。これには数分の時間がかかる場合があります。
検証
Automation Controller からの Ansible Automation Platform Operator のインストールによって提供される次の Operator Pod が実行されていることを確認します。
Operator マネージャーコントローラー | Automation Controller | Automation Hub | Event-Driven Ansible (EDA) |
---|---|---|---|
3 つの Operator それぞれの Operator マネージャーコントローラー。次のものが含まれます。
| Automation Controller のデプロイ後に、次の Pod が追加されていることを確認できます。
| Automation Hub のデプロイ後に、次の Pod が追加されていることを確認できます。
| EDA のデプロイ後に、次の Pod が追加されていることを確認できます。
|
Pod が見つからない場合は、プルシークレットが必要であることを示している可能性があります。プルシークレットは、保護されたイメージレジストリーまたはプライベートイメージレジストリーに必要です。詳細は、イメージプルシークレットの使用 を参照してください。oc describe pod <pod-name>
を実行して、その Pod に ImagePullBackOff エラーがあるかどうかを確認することで、この問題をさらに診断できます。
3.2.2. Red Hat Ansible Automation Platform Operator に Automation Controller 用の外部データベースを設定する
外部データベースを使用して Ansible Automation Platform をデプロイすることを希望するユーザーは、インスタンスの認証情報と接続情報を使用してシークレットを設定し、oc create
コマンドを使用してクラスターに適用するとデプロイできるようになります。
デフォルトでは、Ansible Automation Platform Operator は、Ansible Automation Platform デプロイメントと同じ namespace にマネージド PostgreSQL Pod を自動的に作成および設定します。Ansible Automation Platform Operator が自動的に作成するマネージド PostgreSQL Pod の代わりに、外部データベースを使用して Ansible Automation Platform をデプロイすることもできます。
外部データベースを使用すると、リソースを共有して再利用でき、バックアップ、アップグレード、およびパフォーマンスの最適化を手動で管理できます。
データベース名が異なる限り、Automation Hub、Automation Controller、プラットフォームゲートウェイに同じ外部データベース (PostgreSQL インスタンス) を使用できます。つまり、単一の PostgreSQL インスタンス内に異なる名前のデータベースを複数指定できます。
次のセクションでは、Ansible Automation Platform Operator に Automation Controller の外部データベースを設定する手順を説明します。
前提条件
外部データベースが、Ansible Automation Platform の現在のリリースでサポートされているバージョンの PostgreSQL データベースを指定している。
Ansible Automation Platform 2.5 は PostgreSQL 15 をサポートしています。
手順
外部の postgres インスタンスの認証情報と接続情報はシークレットに保存する必要があります。この情報は、Automation Controller 仕様に設定されます。
以下のテンプレートに従って、
postgres_configuration_secret
YAML ファイルを作成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: v1 kind: Secret metadata: name: external-postgres-configuration namespace: <target_namespace> stringData: host: "<external_ip_or_url_resolvable_by_the_cluster>" port: "<external_port>" database: "<desired_database_name>" username: "<username_to_connect_as>" password: "<password_to_connect_with>" sslmode: "prefer" type: "unmanaged" type: Opaque
apiVersion: v1 kind: Secret metadata: name: external-postgres-configuration namespace: <target_namespace>
1 stringData: host: "<external_ip_or_url_resolvable_by_the_cluster>"
2 port: "<external_port>"
3 database: "<desired_database_name>" username: "<username_to_connect_as>" password: "<password_to_connect_with>"
4 sslmode: "prefer"
5 type: "unmanaged" type: Opaque
- 1
- シークレットを作成する namespace。これは、デプロイ先の namespace と同じにする必要があります。
- 2
- データベースノードの解決可能なホスト名です。
- 3
- 外部ポートのデフォルトは
5432
です。 - 4
- 変数
password
の値には、デプロイ、バックアップ、または復元中の問題を回避するために、一重引用符 (')、二重引用符 (")、またはバックスラッシュ (\) を含めないでください。 - 5
- 変数
sslmode
は、external
データベースに対してのみ有効です。使用できる値は、prefer
、disable
、allow
、require
、verify-ca
、およびverify-full
です。
oc create
コマンドを使用して、external-postgres-configuration-secret.yml
をクラスターに適用します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create -f external-postgres-configuration-secret.yml
$ oc create -f external-postgres-configuration-secret.yml
AutomationController
カスタムリソースオブジェクトを作成するときは、以下の例に従って、仕様にシークレットを指定します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: controller-dev spec: postgres_configuration_secret: external-postgres-configuration
apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: controller-dev spec: postgres_configuration_secret: external-postgres-configuration
3.2.3. PVC の検索および削除
Persistent Volume Claim (PVC) は、Automation Hub および Automation Controller アプリケーションが使用するデータを保存するために使用されるストレージボリュームです。これらの PVC はアプリケーションから独立しており、アプリケーションが削除されてもそのまま残ります。PVC が不要になるか、これを別の場所でバックアップしている場合には手動で削除できます。
手順
デプロイメント namespace にある既存 PVC をリスト表示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get pvc -n <namespace>
oc get pvc -n <namespace>
- 以前のデプロイメント名と PVC 名を比較して、以前のデプロイメントに関連付けられている PVC を特定します。
以前の PVC を削除します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete pvc -n <namespace> <pvc-name>
oc delete pvc -n <namespace> <pvc-name>
3.2.4. 関連情報
- OpenShift Container Platform における Operator の実行に関する詳細は、OpenShift Container Platform 製品ドキュメント に移動し、Operator - OpenShift Container Platform での Operator の使用 をクリックしてください。