postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Support for S3 backup injection in a custom resource

Open Conor-Quin opened this issue 7 years ago • 6 comments

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

Conor-Quin avatar Aug 07 '19 16:08 Conor-Quin

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 avatar Aug 07 '19 18:08 lkhomenk

@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

NiharDudam avatar Aug 07 '19 18:08 NiharDudam

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 avatar Aug 07 '19 20:08 lkhomenk

@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

NiharDudam avatar Aug 08 '19 00:08 NiharDudam

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

lkhomenk avatar Aug 08 '19 07:08 lkhomenk

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:)

jkatz avatar Jan 04 '20 20:01 jkatz