An `ObjectStore` already lets users tack extra command-line flags onto three of the four `barman-cloud-*` invocations: `barman-cloud-backup` via `data.additionalCommandArgs`, `barman-cloud-wal-archive` via `wal.archiveAdditionalCommandArgs`, and `barman-cloud-wal-restore` via `wal.restoreAdditionalCommandArgs`. The fourth — `barman-cloud-restore`, the actual data-restore step in PITR and recovery-from-object-store — has had no equivalent, which is exactly the gap reported in #821 (the asker wanted a longer `--read-timeout` for slow restores from S3). This PR fills that gap by adding `spec.configuration.data.restoreAdditionalCommandArgs` and wiring it into the recovery job hook. In `restoreDataDir`, the user-supplied flags are appended after the cloud-provider options and `--endpoint-url` but before the positional `(destinationPath, serverName, backupID, pgdata)` arguments — same shape as the other three knobs. The library's existing append/dedup logic still wins on conflicts, so users can't accidentally override flags the plugin already sets (`--cloud-provider`, `--endpoint-url`, etc.). Closes #821 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
2.9 KiB
| sidebar_position |
|---|
| 90 |
Miscellaneous
Backup Object Tagging
You can attach key-value metadata tags to backup artifacts—such as base
backups, WAL files, and history files—via the .spec.configuration section of
the ObjectStore resource.
tags: applied to base backups and WAL fileshistoryTags: applied to history files only
Example
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
[...]
tags:
backupRetentionPolicy: "expire"
historyTags:
backupRetentionPolicy: "keep"
[...]
Extra Options for Backup, WAL Archiving, and Restore
You can pass additional command-line arguments to the underlying
barman-cloud-* commands using the corresponding fields in the ObjectStore
configuration.
.spec.configuration.data.additionalCommandArgs: forbarman-cloud-backup.spec.configuration.data.restoreAdditionalCommandArgs: forbarman-cloud-restore.spec.configuration.wal.archiveAdditionalCommandArgs: forbarman-cloud-wal-archive.spec.configuration.wal.restoreAdditionalCommandArgs: forbarman-cloud-wal-restore
Each field accepts a list of string arguments. If an argument conflicts with one already set by the plugin, the user-provided value will be ignored. These fields are intended to pass options the plugin does not configure automatically.
Example: Extra Backup Options
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
data:
additionalCommandArgs:
- "--min-chunk-size=5MB"
- "--read-timeout=60"
Example: Extra Restore Options
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
data:
restoreAdditionalCommandArgs:
- "--read-timeout=900"
Example: Extra WAL Archive Options
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
wal:
archiveAdditionalCommandArgs:
- "--max-concurrency=1"
- "--read-timeout=60"
Example: Extra WAL Restore Options
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
wal:
restoreAdditionalCommandArgs:
- "--read-timeout=60"
For a complete list of supported options, refer to the official Barman Cloud documentation.
Enable the pprof debug server for the sidecar
You can enable the instance sidecar's pprof debug HTTP server by adding the --pprof-server=<address> flag to the container's
arguments via .spec.instanceSidecarConfiguration.additionalContainerArgs.
Pass a bind address in the form <host>:<port> (for example, 0.0.0.0:6061).
An empty value disables the server (disabled by default).
Example
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: my-store
spec:
instanceSidecarConfiguration:
additionalContainerArgs:
- "--pprof-server=0.0.0.0:6061"