Skip to content

Commit b8a6c92

Browse files
authored
AAP-33715 adding postgres db section (#2384)
1 parent e42b031 commit b8a6c92

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

downstream/assemblies/platform/assembly-configure-aap-operator.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ If you have the {OperatorPlatformNameShort} and some or all of the {PlatformName
2626
include::platform/proc-operator-link-components.adoc[leveloffset=+1]
2727
include::platform/proc-operator-access-aap.adoc[leveloffset=+1]
2828
include::platform/proc-operator-deploy-central-config.adoc[leveloffset=+1]
29+
include::platform/proc-operator-external-db-gateway.adoc[leveloffset=+1]
2930
include::platform/proc-operator-aap-faq.adoc[leveloffset=+1]
3031

3132
ifdef::parent-context[:context: {parent-context}]

downstream/modules/platform/proc-operator-external-db-controller.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Using an external database lets you share and reuse resources and manually manag
1212

1313
[NOTE]
1414
====
15-
The same external database (PostgreSQL instance) can be used for both {HubName} and {ControllerName} 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+
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.
1616
====
1717

1818
The following section outlines the steps to configure an external database for your {ControllerName} on a {OperatorPlatformNameShort}.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
----

downstream/modules/platform/proc-operator-external-db-hub.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can choose to use an external database instead if you prefer to use a dedica
1212

1313
[NOTE]
1414
====
15-
The same external database (PostgreSQL instance) can be used for both {HubName} and {ControllerName} 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+
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.
1616
====
1717

1818
The following section outlines the steps to configure an external database for your {HubName} on a {OperatorPlatformNameShort}.

0 commit comments

Comments
 (0)