@@ -102,7 +102,7 @@ As you can see, the contents of `barmanObjectStore` have been copied directly
102102under the `configuration` field of the `ObjectStore` resource, using the same
103103secret references.
104104
105- # # Step 2: Update the `Cluster`
105+ # # Step 2: Update the `Cluster` for plugin WAL archiving
106106
107107Once the `ObjectStore` resource is in place, update the `Cluster` resource as
108108follows 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