Skip to content

Commit 9f8b512

Browse files
committed
RHDEVDOCS-5384: Fix formatting in the migrating procedure for tehtin hub in Pipelines doc
1 parent bdffb88 commit 9f8b512

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

modules/op-migrating-tekton-hub-data-to-an-existing-crunchy-postgres-database.adoc

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,51 @@
1919
----
2020
$ pg_dump -Ft -h localhost -U postgres hub -f /tmp/hub.dump
2121
----
22-
22+
+
2323
. Copy the file containing the data dump to your local system.
2424
+
2525
.Command format
2626
[source,terminal]
2727
----
2828
$ oc cp -n <namespace> <podName>:<path-to-hub.dump> <path-to-local-system>
2929
----
30+
+
3031
.Example
3132
[source,terminal]
3233
----
3334
$ oc cp -n openshift-pipelines tekton-hub-db-7d6d888c67-p7mdr:/tmp/hub.dump /home/test_user/Downloads/hub.dump
3435
----
35-
36+
+
3637
. Copy the file that contains the data dump from the local system to the pod running the external Crunchy Postgres database.
3738
+
3839
.Command format
3940
[source,terminal]
4041
----
4142
$ oc cp -n <namespace> <path-to-local-system> <podName>:<path-to-hub.dump>
4243
----
44+
+
4345
.Example
4446
[source,terminal]
4547
----
4648
$ oc cp -n openshift-operators /home/test_user/Downloads/hub.dump test-instance1-spnz-0:/tmp/hub.dump
4749
----
48-
49-
. Restore the data in the Crunchy Postgres database.
50+
+
51+
. Restore the data in the Crunchy Postgres database.
52+
+
5053
.Command format
5154
[source,terminal]
5255
----
5356
$ pg_restore -d <database-name> -h localhost -U postgres <path-where-file-is-copied>
5457
----
58+
+
5559
.Example
5660
[source,terminal]
5761
----
5862
$ pg_restore -d test -h localhost -U postgres /tmp/hub.dump
5963
----
60-
64+
+
6165
. Get into the Crunchy Postgres pod.
62-
.Example: Get into the `test-instance1-m7hh-0` pod
66+
.Example: Get into the `test-instance1-m7hh-0` pod
6367
+
6468
[source,terminal]
6569
----
@@ -71,22 +75,22 @@ sh-4.4$ psql -U postgres
7175
psql (14.4)
7276
Type "help" for help.
7377
----
74-
78+
+
7579
. Find the `pg_hba.conf` file.
7680
+
7781
[source,terminal]
7882
----
7983
postgres=# SHOW hba_file;
80-
hba_file
84+
hba_file
8185
--------------------------
8286
/pgdata/pg14/pg_hba.conf
8387
(1 row)
8488

8589
postgres=#
8690
----
87-
91+
+
8892
. Exit from the database.
89-
93+
+
9094
. Check if the `pg_hba.conf` file has the entry `host all all 0.0.0.0/0 md5`, which is necessary for accessing all incoming connections. If necessary, add the entry at the end of the `pg_hba.conf` file.
9195
+
9296
.Example: `pg_hba.conf` file
@@ -103,7 +107,7 @@ host all "_crunchyrepl" all reject
103107
hostssl all all all md5
104108
host all all 0.0.0.0/0 md5
105109
----
106-
110+
+
107111
. Save the `pg_hba.conf` file and reload the database.
108112
+
109113
[source,terminal]
@@ -113,7 +117,7 @@ psql (14.4)
113117
Type "help" for help.
114118

115119
postgres=# SHOW hba_file;
116-
hba_file
120+
hba_file
117121
--------------------------
118122
/pgdata/pg14/pg_hba.conf
119123
(1 row)
@@ -124,10 +128,9 @@ postgres=# SELECT pg_reload_conf();
124128
t
125129
(1 row)
126130
----
127-
131+
+
128132
. Exit the database.
129-
130-
. Verify that a secret named `tekton-hub-db` in the target namespace has the following keys:
133+
. Verify that a secret named `tekton-hub-db` in the target namespace has the following keys:
131134
* `POSTGRES_HOST`
132135
* `POSTGRES_DB`
133136
* `POSTGRES_USER`
@@ -145,29 +148,29 @@ metadata:
145148
app: tekton-hub-db
146149
type: Opaque
147150
stringData:
148-
POSTGRES_HOST: test-primary.openshift-operators.svc
151+
POSTGRES_HOST: test-primary.openshift-operators.svc
149152
POSTGRES_DB: test
150153
POSTGRES_USER: test
151-
POSTGRES_PASSWORD: woXOisU5>ocJiTF7y{{;1[Q(
154+
POSTGRES_PASSWORD: woXOisU5>ocJiTF7y{{;1[Q(
152155
POSTGRES_PORT: '5432'
153156
...
154157
----
155158
+
156159
[NOTE]
157160
====
158161
The value of the `POSTGRES_HOST` field is encoded as a secret. You can decode the value of the Crunchy Postgres host by using the following example.
159-
+
160-
.Example: Decode the secret value of a Crunchy Postgres host
162+
163+
.Example: Decode the secret value of a Crunchy Postgres host
161164
[source,terminal]
162165
----
163166
$ echo 'aGlwcG8tcHJpbWFyeS5vcGVuc2hpZnQtb3BlcmF0b3JzLnN2YyA=' | base64 --decode
164167
test-primary.openshift-operators.svc
165168
----
166169
====
167-
170+
+
168171
. Verify that in the `TektonHub` CR, the value of the database secret attribute is `tekton-hub-db`.
169172
+
170-
.Example: TektonHub CR with the name of the database secret
173+
.Example: TektonHub CR with the name of the database secret
171174
[source,yaml]
172175
----
173176
apiVersion: operator.tekton.dev/v1alpha1
@@ -176,18 +179,18 @@ metadata:
176179
name: hub
177180
spec:
178181
targetNamespace: openshift-pipelines
179-
db:
180-
secret: tekton-hub-db
182+
db:
183+
secret: tekton-hub-db
181184
...
182185
----
183-
186+
+
184187
. To associate the external Crunchy Postgres database with {tekton-hub}, replace any existing `TektonHub` CR with the updated `TektonHub` CR.
185188
+
186189
[source,terminal]
187190
----
188191
$ oc replace -f <updated-tekton-hub-cr>.yaml
189192
----
190-
193+
+
191194
. Check the status of the {tekton-hub}. The updated `TektonHub` CR might take some time to attain a steady state.
192195
+
193196
[source,terminal]
@@ -201,6 +204,3 @@ $ oc get tektonhub.operator.tekton.dev
201204
NAME VERSION READY REASON APIURL UIURL
202205
hub v1.9.0 True https://api.route.url/ https://ui.route.url/
203206
----
204-
205-
206-

0 commit comments

Comments
 (0)