Skip to content

Commit 67d604b

Browse files
committed
consistent names for database secrets
Signed-off-by: Fabrice Flore-Thébault <[email protected]>
1 parent 6da1534 commit 67d604b

File tree

5 files changed

+37
-35
lines changed

5 files changed

+37
-35
lines changed

artifacts/attributes.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
:my-product-cr-name: my-rhdh-custom-resource
2626
:my-product-namespace: my-rhdh-project
2727
:my-product-secrets: my-rhdh-secrets
28+
:my-product-database-certificates-secrets: my-rhdh-database-certificates-secrets
29+
:my-product-database-secrets: my-rhdh-database-secrets
2830
:my-product-url: https://__<my_developer_hub_url>__
2931

3032
// Red Hat Platforms

modules/configuring-external-databases/proc-configuring-postgresql-instance-using-helm.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can configure an external PostgreSQL instance by using the Helm Chart. By de
77

88
* You are using a supported version of PostgreSQL. For more information, see the link:https://access.redhat.com/support/policy/updates/developerhub[Product life cycle page].
99
* You have the following details:
10-
** `db-host`: Denotes your PostgreSQL instance Domain Name System (DNS) or IP address
10+
** `db-host`: Denotes your PostgreSQL instance Domain Name System (DNS) or IP address
1111
** `db-port`: Denotes your PostgreSQL instance port number, such as `5432`
1212
** `username`: Denotes the user name to connect to your PostgreSQL instance
1313
** `password`: Denotes the password to connect to your PostgreSQL instance
@@ -16,21 +16,21 @@ You can configure an external PostgreSQL instance by using the Helm Chart. By de
1616

1717
[NOTE]
1818
====
19-
By default, {product-short} uses a database for each plugin and automatically creates it if none is found. You might need the `Create Database` privilege in addition to `PSQL Database` privileges for configuring an external PostgreSQL instance.
19+
By default, {product-short} uses a database for each plugin and automatically creates it if none is found. You might need the `Create Database` privilege in addition to `PSQL Database` privileges for configuring an external PostgreSQL instance.
2020
====
21-
21+
2222

2323
.Procedure
2424

25-
. Optional: Create a certificate secret to configure your PostgreSQL instance with a TLS connection:
25+
. Optional: Create a certificate secret to configure your PostgreSQL instance with a TLS connection:
2626
+
2727
[source,terminal]
2828
----
2929
cat <<EOF | oc -n <your-namespace> create -f -
3030
apiVersion: v1
3131
kind: Secret
3232
metadata:
33-
name: <crt-secret> <1>
33+
name: {my-product-database-certificates-secrets} <1>
3434
type: Opaque
3535
stringData:
3636
postgres-ca.pem: |-
@@ -39,11 +39,11 @@ stringData:
3939
postgres-key.key: |-
4040
-----BEGIN CERTIFICATE-----
4141
<tls-private-key> <3>
42-
postgres-crt.pem: |-
42+
postgres-crt.pem: |-
4343
-----BEGIN CERTIFICATE-----
4444
<tls-certificate-key> <4>
4545
# ...
46-
EOF
46+
EOF
4747
----
4848
<1> Provide the name of the certificate secret.
4949
<2> Provide the CA certificate key.
@@ -58,7 +58,7 @@ cat <<EOF | oc -n <your-namespace> create -f -
5858
apiVersion: v1
5959
kind: Secret
6060
metadata:
61-
name: <cred-secret> <1>
61+
name: {my-product-database-secrets} <1>
6262
type: Opaque
6363
stringData: <2>
6464
POSTGRES_PASSWORD: <password>
@@ -83,7 +83,7 @@ upstream:
8383
postgresql:
8484
enabled: false # disable PostgreSQL instance creation <1>
8585
auth:
86-
existingSecret: <cred-secret> # inject credentials secret to Backstage <2>
86+
existingSecret: {my-product-database-secrets} # inject credentials secret to Backstage <2>
8787
backstage:
8888
appConfig:
8989
backend:
@@ -102,7 +102,7 @@ upstream:
102102
cert:
103103
$file: /opt/app-root/src/postgres-crt.pem
104104
extraEnvVarsSecrets:
105-
- <cred-secret> # inject credentials secret to Backstage <3>
105+
- {my-product-database-secrets} # inject credentials secret to Backstage <3>
106106
extraEnvVars:
107107
- name: BACKEND_SECRET
108108
valueFrom:
@@ -120,7 +120,7 @@ upstream:
120120
subPath: postgres-ca.pem
121121
- mountPath: /opt/app-root/src/postgres-key.key
122122
name: postgres-key # inject TLS private key to Backstage cont. <6>
123-
subPath: postgres-key.key
123+
subPath: postgres-key.key
124124
extraVolumes:
125125
- ephemeral:
126126
volumeClaimTemplate:
@@ -143,10 +143,10 @@ upstream:
143143
secretName: dynamic-plugins-npmrc
144144
- name: postgres-crt
145145
secret:
146-
secretName: <crt-secret> <7>
146+
secretName: {my-product-database-certificates-secrets} <7>
147147
# ...
148148
----
149-
<1> Set the value of the `upstream.postgresql.enabled` parameter to `false` to disable creating local PostgreSQL instances.
149+
<1> Set the value of the `upstream.postgresql.enabled` parameter to `false` to disable creating local PostgreSQL instances.
150150
<2> Provide the name of the credential secret.
151151
<3> Provide the name of the credential secret.
152152
<4> Optional: Provide the name of the TLS certificate only for a TLS connection.

modules/configuring-external-databases/proc-configuring-postgresql-instance-using-the-operator.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ By default, {product-short} uses a database for each plugin and automatically cr
2424

2525
. Optional: Create a certificate secret to configure your PostgreSQL instance with a TLS connection:
2626
+
27-
[source,yaml]
27+
[source,yaml,subs="+attributes,+quotes"]
2828
----
29-
cat <<EOF | oc -n <your-namespace> create -f -
29+
cat <<EOF | oc -n {my-product-namespace} create -f -
3030
apiVersion: v1
3131
kind: Secret
3232
metadata:
33-
name: <crt-secret> <1>
33+
name: {my-product-database-certificates-secrets} <1>
3434
type: Opaque
3535
stringData:
3636
postgres-ca.pem: |-
@@ -52,13 +52,13 @@ EOF
5252

5353
. Create a credential secret to connect with the PostgreSQL instance:
5454
+
55-
[source,yaml]
55+
[source,yaml,subs="+attributes,+quotes"]
5656
----
57-
cat <<EOF | oc -n <your-namespace> create -f -
57+
cat <<EOF | oc -n {my-product-namespace} create -f -
5858
apiVersion: v1
5959
kind: Secret
6060
metadata:
61-
name: <cred-secret> <1>
61+
name: {my-product-database-secrets} <1>
6262
type: Opaque
6363
stringData: <2>
6464
POSTGRES_PASSWORD: <password>
@@ -74,11 +74,11 @@ EOF
7474
<3> Optional: Provide the value based on the required link:https://www.postgresql.org/docs/15/libpq-connect.html#LIBPQ-CONNECT-SSLMODE[Secure Sockets Layer (SSL) mode].
7575
<4> Optional: Provide the value only if you need a TLS connection for your PostgreSQL instance.
7676

77-
. Create a `Backstage` custom resource (CR):
77+
. Create a `{product-custom-resource-type}` custom resource (CR):
7878
+
79-
[source,terminal]
79+
[source,terminal,subs="+attributes,+quotes"]
8080
----
81-
cat <<EOF | oc -n <your-namespace> create -f -
81+
cat <<EOF | oc -n {my-product-namespace} create -f -
8282
apiVersion: rhdh.redhat.com/v1alpha3
8383
kind: Backstage
8484
metadata:
@@ -90,11 +90,11 @@ spec:
9090
extraFiles:
9191
mountPath: <path> # e g /opt/app-root/src
9292
secrets:
93-
- name: <crt-secret> <2>
94-
key: postgres-crt.pem, postgres-ca.pem, postgres-key.key # key name as in <crt-secret> Secret
93+
- name: {my-product-database-certificates-secrets} <2>
94+
key: postgres-crt.pem, postgres-ca.pem, postgres-key.key # key name as in {my-product-database-certificates-secrets} Secret
9595
extraEnvs:
9696
secrets:
97-
- name: <cred-secret> <3>
97+
- name: {my-product-database-secrets} <3>
9898
# ...
9999
----
100100
<1> Set the value of the `enableLocalDb` parameter to `false` to disable creating local PostgreSQL instances.
@@ -106,4 +106,4 @@ spec:
106106
The environment variables listed in the `Backstage` CR work with the Operator default configuration. If you have changed the Operator default configuration, you must reconfigure the `Backstage` CR accordingly.
107107
====
108108

109-
. Apply the `Backstage` CR to the namespace where you have deployed the {product-very-short} instance.
109+
. Apply the `{product-custom-resource-type}` CR to the namespace where you have deployed the {product-short} instance.

modules/configuring-external-databases/proc-migrating-databases-to-an-external-server.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ spec:
9191
# ...
9292
extraFiles:
9393
secrets:
94-
- name: <crt-secret>
95-
key: postgres-crt.pem # key name as in <crt-secret> Secret
94+
- name: {my-product-database-certificates-secrets}
95+
key: postgres-crt.pem # key name as in {my-product-database-certificates-secrets} Secret
9696
extraEnvs:
9797
secrets:
98-
- name: <cred-secret>
98+
- name: {my-product-database-secrets}
9999
# ...
100100
----
101101
+

modules/configuring/proc-using-the-operator-to-run-rhdh-with-your-custom-configuration.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ spec:
6161
extraEnvs:
6262
secrets:
6363
- name: {my-product-secrets}
64-
- name: cred-secret
64+
- name: {my-product-database-secrets}
6565
extraFiles:
6666
mountPath: /opt/app-root/src
6767
secrets:
68-
- name: crt-secret
68+
- name: {my-product-database-certificates-secrets}
6969
key: postgres-crt.pem, postgres-ca.pem, postgres-key.key
7070
replicas: 1
7171
route:
@@ -139,7 +139,7 @@ spec:
139139
----
140140
====
141141
+
142-
.Register the `{my-product-secrets}` and `cred-secret` secrets
142+
.Register the `{my-product-secrets}` and `{my-product-database-secrets}` secrets
143143
====
144144
[source,yaml,subs="+attributes,+quotes"]
145145
----
@@ -148,22 +148,22 @@ spec:
148148
extraEnvs:
149149
secrets:
150150
- name: {my-product-secrets}
151-
- name: cred-secret
151+
- name: {my-product-database-secrets}
152152
----
153153
====
154154

155155
spec.application.extraFiles.secrets::
156156
Enter your certificates files secret name and files list.
157157
+
158-
.Register the `crt-secret` secret containing the `postgres-crt.pem`, `postgres-ca.pem`, and `postgres-key.key` files
158+
.Register the `{my-product-database-certificates-secrets}` secret containing the `postgres-crt.pem`, `postgres-ca.pem`, and `postgres-key.key` files
159159
[source,yaml,subs="+attributes,+quotes"]
160160
----
161161
spec:
162162
application:
163163
extraFiles:
164164
mountPath: /opt/app-root/src
165165
secrets:
166-
- name: crt-secret
166+
- name: {my-product-database-certificates-secrets}
167167
key: postgres-crt.pem, postgres-ca.pem, postgres-key.key
168168
----
169169

0 commit comments

Comments
 (0)