plugin-barman-cloud/web/docs/misc.md
David Almgren 77113f68df feat: expose showAdditionalCommandArgs and listAdditionalCommandArgs
An ObjectStore lets users tack extra command-line flags onto four of
the six barman-cloud-* invocations the plugin shells out to:
barman-cloud-backup (data.additionalCommandArgs), -wal-archive
(wal.archiveAdditionalCommandArgs), -wal-restore
(wal.restoreAdditionalCommandArgs), and -restore (data.restoreAdditionalCommandArgs,
PR #914).

The remaining two -- barman-cloud-backup-show (post-write verification)
and barman-cloud-backup-list (retention pruning) -- had no equivalent,
which is the gap reported in #712. On strictly-vhost S3-compatible
endpoints users need `--addressing-style=virtual` on every cloud
command, and currently those two reject the user-provided args, marking
otherwise-successful backups as failed and silently disabling retention
pruning.

The library-side change adds the two new fields and helpers (sister PR
in cloudnative-pg/barman-cloud) and threads them through GetBackupList /
GetBackupByName. This plugin commit just exposes them via the CRD and
documents the new shape.

## Sister PR (must merge first)

The CRD field schema is generated from the BarmanObjectStoreConfiguration
Go type in cloudnative-pg/barman-cloud. The sister PR there adds:

- DataBackupConfiguration.ShowAdditionalCommandArgs []string
- DataBackupConfiguration.ListAdditionalCommandArgs []string
- AppendShowAdditionalCommandArgs / AppendListAdditionalCommandArgs helpers

Once that PR merges and a barman-cloud release is cut, controller-gen
here picks up the new fields automatically. Until then a developer
running \`go test ./...\` against this branch needs a local replace
directive in go.mod pointing at the barman-cloud branch (omitted from
this commit).

Closes #712

Signed-off-by: David Almgren <dalmgren@coreweave.com>
2026-05-26 12:19:13 +02:00

2.8 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 files
  • historyTags: 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, Show, and List

You can pass additional command-line arguments to each barman-cloud invocation the plugin shells out to, using the matching additionalCommandArgs fields in the ObjectStore configuration.

  • .spec.configuration.data.additionalCommandArgs: for barman-cloud-backup
  • .spec.configuration.data.showAdditionalCommandArgs: for barman-cloud-backup-show (post-write verification)
  • .spec.configuration.data.listAdditionalCommandArgs: for barman-cloud-backup-list (retention pruning)
  • .spec.configuration.wal.archiveAdditionalCommandArgs: for barman-cloud-wal-archive

If you need a flag that applies to every cloud command — such as --addressing-style=virtual for an S3-compatible endpoint that only accepts virtual-hosted-style requests — set it on all of the above so both writes and the post-write read-back / retention steps honor it.

Each field accepts a list of string arguments. If an argument is already configured elsewhere in the plugin, the duplicate will be ignored.

Example: Extra Backup Options

kind: ObjectStore
metadata:
  name: my-store
spec:
  configuration:
    data:
      additionalCommandArgs:
        - "--min-chunk-size=5MB"
        - "--read-timeout=60"

Example: Extra WAL Archive Options

kind: ObjectStore
metadata:
  name: my-store
spec:
  configuration:
    wal:
      archiveAdditionalCommandArgs:
        - "--max-concurrency=1"
        - "--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"