Skip to content

Commit e89f09c

Browse files
committed
docs: document replica cluster migration
Add a documentation section about updating the externalClusters to use the plugin. Closes #322 Signed-off-by: Francesco Canovai <[email protected]>
1 parent fc0d141 commit e89f09c

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

web/docs/migration.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ As you can see, the contents of `barmanObjectStore` have been copied directly
102102
under the `configuration` field of the `ObjectStore` resource, using the same
103103
secret references.
104104

105-
## Step 2: Update the `Cluster`
105+
## Step 2: Update the `Cluster` for plugin WAL archiving
106106

107107
Once the `ObjectStore` resource is in place, update the `Cluster` resource as
108108
follows in a single atomic change:
@@ -174,3 +174,84 @@ spec:
174174
```
175175

176176
---
177+
178+
## Step 4: Update `externalClusters` configuration
179+
180+
If the cluster has external clusters that use the built-in Barman
181+
Cloud integration, you'll need to update those configurations as well.
182+
183+
When a cluster is configured as a replica using an external Barman Cloud backup,
184+
you need to:
185+
186+
1. Create an `ObjectStore` resource for the external cluster, similar to the one
187+
created in [step 1](#step-1-define-the-objectstore)
188+
2. Update the `externalClusters` section in your replica cluster to reference
189+
the plugin
190+
191+
### Example
192+
193+
Original external cluster configuration using in-tree backup:
194+
195+
```yaml
196+
apiVersion: postgresql.cnpg.io/v1
197+
kind: Cluster
198+
metadata:
199+
name: pg-us
200+
spec:
201+
# [...]
202+
externalClusters:
203+
- name: pg-eu
204+
barmanObjectStore:
205+
destinationPath: s3://backups/
206+
endpointURL: http://minio-eu:9000
207+
serverName: pg-eu
208+
s3Credentials:
209+
accessKeyId:
210+
name: minio-eu
211+
key: ACCESS_KEY_ID
212+
secretAccessKey:
213+
name: minio-eu
214+
key: ACCESS_SECRET_KEY
215+
wal:
216+
compression: gzip
217+
```
218+
219+
Create the `ObjectStore` resource for the external cluster:
220+
221+
```yaml
222+
apiVersion: barmancloud.cnpg.io/v1
223+
kind: ObjectStore
224+
metadata:
225+
name: minio-eu
226+
spec:
227+
configuration:
228+
destinationPath: s3://backups/
229+
endpointURL: http://minio-eu:9000
230+
s3Credentials:
231+
accessKeyId:
232+
name: minio-eu
233+
key: ACCESS_KEY_ID
234+
secretAccessKey:
235+
name: minio-eu
236+
key: ACCESS_SECRET_KEY
237+
wal:
238+
compression: gzip
239+
```
240+
241+
Update the external cluster configuration to use the plugin:
242+
243+
```yaml
244+
apiVersion: postgresql.cnpg.io/v1
245+
kind: Cluster
246+
metadata:
247+
name: pg-us
248+
spec:
249+
# [...]
250+
externalClusters:
251+
- name: pg-eu
252+
plugin:
253+
name: barman-cloud.cloudnative-pg.io
254+
parameters:
255+
barmanObjectName: minio-eu
256+
serverName: pg-eu
257+
```

0 commit comments

Comments
 (0)