Support for S3 backup injection in a custom resource
What is the motivation or use case for the feature? Currently, the support for S3 backup is configured using a configmap during deployment of the operator
Describe the solution you'd like
Add backup configurations in Pgcluster custom resource and make operator listen to the updates made to backup configurations in Pgcluster custom resource
if you create cluster with --pgbackrest it's configuration can be changed later to backup to S3. adding pgbackrst after cluster was created required maintenance anyway and cluster restart. it might be easier to backup data - create new cluster with pgbackrest On and restore after from backup
@lkhomenk I think we need to use pgo command line to change the backup configuration after creating the cluster.
We cannot use the command-line tool and want to update backup configurations in PgCluster custom resource. Currently Pgcluster custom resource does not store backup configurations
pgo utility triggers 'pgbackrest', which depends on predefined PGBACKREST_* variables. But you can also add custom attributes to it. Minor exception - stanza creation can't be triggered via pgo, all others like info, backup are doable
@lkhomenk Afaik PGBACKREST_* variables are defined in inventory and those are injected into config map during cluster creation and pgo command line is used to update backrest parameters in the config map. (Correct me if I am wrong)
As mentioned below we want these backrest configs defined in Pgcluster Custom resource instead of config maps or maybe in both so that Crunchy operator listens to Pgcluster Custome resource and grab the PGBACKREST_* variables
you can edit conf/postgres-operator/pgo-backrest-repo-template.json or conf/postgres-operator/cluster-deployment.json according to your needs and apply your pgbackrest config that way. or even adding your own envFrom with config you need
ASFAIK Pgcluster CRD doesn't reflect current situation - create cluster with 0 replicas - edit crd by adding replicas - no replicas pods will be added. same would be with pgbackrest option. to be honest - this option is kinda dangerous. Archive command has to be updated/new env_vars added. all this requires Cluster restart and maintenance for you DB
I would be curious to hear the group's experience on accomplishing this with v4.2.0 before closing this issue. I believe on creating a Pgcluster directly in the custom resource, this will work fine. I do not believe it will work on updating the Pgcluster directly, but we do have in our roadmap to ensure our CRs can react to change (though give us a bit more time on that last bit :wink:)