3.3. Red Hat Ansible Automation Platform オペレーターでの Automation Controller 用の外部データベースの設定
外部データベースを使用して Ansible Automation Platform をデプロイすることを希望するユーザーは、インスタンスの認証情報と接続情報を使用してシークレットを設定し、oc create コマンドを使用してクラスターに適用するとデプロイできるようになります。
デフォルトでは、Red Hat Ansible Automation Platform オペレーターは、Ansible Automation Platform デプロイメントと同じ名前空間でマネージド PostgreSQLPod を自動的に作成および設定します。Red Hat Ansible Automation Platform Operator が自動作成するマネージド PostgreSQL Pod ではなく、外部データベースで Ansible Automation Platform をデプロイできます。
外部データベースを使用すると、リソースを共有して再利用でき、バックアップ、アップグレード、およびパフォーマンスの最適化を手動で管理できます。
データベース名が異なる限り、Automation Hub と Automation Controller の両方に同じ外部データベース (PostgreSQL インスタンス) を使用できます。つまり、単一の PostgreSQL インスタンス内に異なる名前のデータベースを複数指定できます。
次のセクションでは、Ansible Automation Platform オペレーターで Automation Controller の外部データベースを設定する手順の概要を説明します。
前提条件
外部データベースが、Ansible Automation Platform の現在のリリースでサポートされているバージョンの PostgreSQL データベースを指定している。
Ansible Automation Platform 2.4 は PostgreSQL 13 をサポートします。
手順
外部の postgres インスタンスのクレデンシャルと接続情報はシークレットに保存する必要があります。シークレットは Automation Controller の仕様に設定されます。
以下のテンプレートに従って、.yaml ファイル
postgres_configuration_secretを作成します。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
- シークレットを作成する名前空間。これは、デプロイ先の名前空間と同じにする必要があります。
- 2
- データベースノードの解決可能なホスト名です。
- 3
- 外部ポートのデフォルトは
5432です。 - 4
- 変数
passwordの値には、デプロイメント、バックアップ、または復元中の問題を回避するために、一重引用符 (') 、二重引用符 (")、またはバックスラッシュ (\) を含めないでください。 - 5
- 変数
sslmodeは、externalデータベースに対してのみ有効です。使用できる値は、prefer、disable、allow、require、verify-ca、およびverify-fullです。
oc createコマンドを使用して、external-postgres-configuration-secret.ymlをクラスターに適用します。$ oc create -f external-postgres-configuration-secret.yml
AutomationControllerカスタムリソースオブジェクトを作成するときは、以下の例に従って、仕様にシークレットを指定します。apiVersion: awx.ansible.com/v1beta1 kind: AutomationController metadata: name: controller-dev spec: postgres_configuration_secret: external-postgres-configuration