charts icon indicating copy to clipboard operation
charts copied to clipboard

feat(cluster): extend backup configuration for volumesnapshot and plugin

Open m4s-b3n opened this issue 10 months ago • 5 comments

Summary of Changes

New Backup Options

This pull request introduces two new backup options to the chart: volumeSnapshot and plugin. These options provide additional flexibility for configuring backups in the CloudNativePG operator.

Volume Snapshots

  • Added support for volume snapshots as a backup method.
  • Configurable parameters include:
    • className
    • walClassName
    • tablespaceClassName
    • snapshotOwnerReference
    • online
    • onlineConfiguration (with waitForArchive and immediateCheckpoint)

Plugin Backups

  • Added support for plugin-based backups.
  • Configurable parameters include:
    • name
    • parameters

Documentation Updates

  • Updated the README.md and README.md.gotmpl files to include documentation for the new backup options.
  • Provided examples for configuring volume snapshots and plugin backups.

Extended Tests

  • Added new test cases to validate the functionality of the new backup options.
  • Extended the existing test suite to cover scenarios involving volume snapshots and plugin backups.

m4s-b3n avatar Feb 19 '25 21:02 m4s-b3n

@itay-grudev please rerun chainsaw tests as the failed one seems to be failed because of an image pull error

m4s-b3n avatar Feb 21 '25 23:02 m4s-b3n

@itay-grudev anything else I can do here?

m4s-b3n avatar Feb 24 '25 08:02 m4s-b3n

No. Thanks a lot. I'll review it when I can. I apologize in advance if I delay you, I am just under a lot of pressure right now.

itay-grudev avatar Feb 24 '25 11:02 itay-grudev

@itay-grudev pull request already got merge conflicts. do you resolve them on merge or do you require me to do this?

m4s-b3n avatar Mar 03 '25 08:03 m4s-b3n

@itay-grudev solved the conflicts by rebasing main

m4s-b3n avatar Mar 12 '25 08:03 m4s-b3n

Is this updated to support 1.26? I couldn't immediately spot how this chart would setup the plugins key, with or without this.

In any case this or something similar should be prioritized, given 1.26 deprecates the inbuilt barman backup support in favor of an official plugin.

jhass avatar May 27 '25 18:05 jhass

Is this updated to support 1.26? I couldn't immediately spot how this chart would setup the plugins key, with or without this.

It is not explicitly updated to 1.26 but it supports the plugin syntax of 1.25 (see example). Have not checked if this syntax has changed yet.

In any case this or something similar should be prioritized, given 1.26 deprecates the inbuilt barman backup support in favor of an official plugin.

The PR hasn't got any attention for months now, so I will not put any work into this until there is some chance to get merged.

m4s-b3n avatar May 30 '25 08:05 m4s-b3n

@m4s-b3n thanks, that's understandable of course. My comment was of course mainly directed at the maintainers.

Anyways, to my understanding of https://cloudnative-pg.io/plugin-barman-cloud/docs/usage/#configuring-wal-archiving and looking at https://cloudnative-pg.io/documentation/1.26/cloudnative-pg.v1/#postgresql-cnpg-io-v1-BackupConfiguration I'm not sure defining backup.pluginConfiguration is longer recommended or supported.

I'm currently having success with patching the chart via a postrender hook invoking kustomize and the following patch:

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: ${name}-cluster
  namespace: ${namespace}
spec:
  plugins:
  - name: barman-cloud.cloudnative-pg.io
    isWALArchiver: true
    parameters:
      barmanObjectName: ${name}

and also patching in an ObjectStore, a secret for the credentials and ScheduledBackup of course.

jhass avatar May 30 '25 10:05 jhass