|
| 1 | +[id="proc-operator-external-db-gateway"] |
| 2 | + |
| 3 | += Configuring an external database for {Gateway} on {OperatorPlatformName} |
| 4 | + |
| 5 | +[role="_abstract"] |
| 6 | +For users who prefer to deploy {PlatformNameShort} with an external database, they can do so by configuring a secret with instance credentials and connection information, then applying it to their cluster using the `oc create` command. |
| 7 | + |
| 8 | +By default, the {OperatorPlatformNameShort} automatically creates and configures a managed PostgreSQL pod in the same namespace as your {PlatformNameShort} deployment. You can deploy {PlatformNameShort} with an external database instead of the managed PostgreSQL pod that the {OperatorPlatformNameShort} automatically creates. |
| 9 | + |
| 10 | +Using an external database lets you share and reuse resources and manually manage backups, upgrades, and performance optimizations. |
| 11 | + |
| 12 | +[NOTE] |
| 13 | +==== |
| 14 | +The same external database (PostgreSQL instance) can be used for both {HubName}, {ControllerName}, and {Gateway} as long as the database names are different. In other words, you can have multiple databases with different names inside a single PostgreSQL instance. |
| 15 | +==== |
| 16 | + |
| 17 | +The following section outlines the steps to configure an external database for your {Gateway} on a {OperatorPlatformNameShort}. |
| 18 | + |
| 19 | +.Prerequisite |
| 20 | +The external database must be a PostgreSQL database that is the version supported by the current release of {PlatformNameShort}. |
| 21 | + |
| 22 | +[NOTE] |
| 23 | +==== |
| 24 | +{PlatformNameShort} {PlatformVers} supports {PostgresVers}. |
| 25 | +==== |
| 26 | + |
| 27 | +.Procedure |
| 28 | + |
| 29 | +The external postgres instance credentials and connection information must be stored in a secret, which is then set on the {Gateway} spec. |
| 30 | + |
| 31 | +. Create a `postgres_configuration_secret` YAML file, following the template below: |
| 32 | ++ |
| 33 | +---- |
| 34 | +apiVersion: v1 |
| 35 | +kind: Secret |
| 36 | +metadata: |
| 37 | + name: external-postgres-configuration |
| 38 | + namespace: <target_namespace> <1> |
| 39 | +stringData: |
| 40 | + host: "<external_ip_or_url_resolvable_by_the_cluster>" <2> |
| 41 | + port: "<external_port>" <3> |
| 42 | + database: "<desired_database_name>" |
| 43 | + username: "<username_to_connect_as>" |
| 44 | + password: "<password_to_connect_with>" <4> |
| 45 | + sslmode: "prefer" <5> |
| 46 | + type: "unmanaged" |
| 47 | +type: Opaque |
| 48 | +---- |
| 49 | +<1> Namespace to create the secret in. This should be the same namespace you want to deploy to. |
| 50 | +<2> The resolvable hostname for your database node. |
| 51 | +<3> External port defaults to `5432`. |
| 52 | +<4> Value for variable `password` should not contain single or double quotes (', ") or backslashes (\) to avoid any issues during deployment, backup or restoration. |
| 53 | +<5> The variable `sslmode` is valid for `external` databases only. The allowed values are: `*prefer*`, `*disable*`, `*allow*`, `*require*`, `*verify-ca*`, and `*verify-full*`. |
| 54 | +. Apply `external-postgres-configuration-secret.yml` to your cluster using the `oc create` command. |
| 55 | ++ |
| 56 | +---- |
| 57 | +$ oc create -f external-postgres-configuration-secret.yml |
| 58 | +---- |
| 59 | +. When creating your `AnsibleAutomationPlatform` custom resource object, specify the secret on your spec, following the example below: |
| 60 | ++ |
| 61 | +---- |
| 62 | +apiVersion: aap.ansible.com/v1alpha1 |
| 63 | +kind: AnsibleAutomationPlatform |
| 64 | +metadata: |
| 65 | + name: example-aap |
| 66 | + Namespace: aap |
| 67 | +spec: |
| 68 | + database: |
| 69 | + database_secret: automation-platform-postgres-configuration |
| 70 | +---- |
0 commit comments