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

Feature request: Configure zero backups

Open kreempuff opened this issue 3 years ago • 8 comments

Have an idea to improve PGO? We'd love to hear it! We're going to need some information from you to learn more about your feature requests.

Please be sure you've done the following:

  • [x] Provide a concise description of your feature request.
  • [x] Describe your use case. Detail the problem you are trying to solve.
  • [x] Describe how you envision that the feature would work.
  • [x] Provide general information about your current PGO environment.

Overview

Make backups optional.

I get an error like this when I try to configure an empty backups section:

The PostgresCluster "example" is invalid: spec.backups.pgbackrest.repos: Invalid value: 0: spec.backups.pgbackrest.repos in body should have at least 1 items

Use Case

Simpler configuration of inconsequential database clusters. Configuring a PG cluster requires the configuring a backup strategy even if the backups won't be used. For example, for dev databases or for testing purposes.

Desired Behavior

The validator should allow objects to be created without any backups configured. Omitting at any level would be acceptable:

  1. An empty repo list
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
...
backups: 
    pgbackrest: 
      repos: []
  1. An empty pgbackrest section
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
...
backups: 
    pgbackrest: {}
  1. An empty backups section
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
...
backups: {} 
  1. No backups section
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
...
instances:
  ...
postgresVersion: 13

Environment

Tell us about your environment:

Please provide the following details:

EKS

  • Platform: EKS
  • Platform Version: 1.21
  • PGO Image Tag: (e.g. ubi8-5.1.0-0)
  • Postgres Version (e.g. 14)
  • Storage: (e.g. hostpath, nfs, or the name of your storage class)
  • Number of Postgres clusters: (XYZ)

Additional Information

Please provide any additional information that may be helpful.

kreempuff avatar Apr 13 '22 14:04 kreempuff

I realize this is not really a good idea in production environments, but in dev backups often don't matter.

#2531 might be related

sagikazarmark avatar Apr 23 '22 19:04 sagikazarmark

See https://github.com/CrunchyData/postgres-operator/pull/2662#issuecomment-922616677

james-callahan avatar Aug 04 '22 12:08 james-callahan

Any movement on this one?

Another use case for no backups is if you are using something like longhorn storage or netapp astra etc then you would rely on them to do backups/restore of your persistent volume claims. Having the operator do this for us and having no option to disable is resulting in a waste of cluster resources (cpu/memory) and disk/storage space for zero benefit.

darktempla avatar Oct 30 '22 11:10 darktempla

Just dropping a quick note here to say that we have a feature in our backlog for disabling backups. This has been a feature requested a few times, so I'm trying to consolidate the issues:

https://github.com/CrunchyData/postgres-operator/issues/3432 https://github.com/CrunchyData/postgres-operator/issues/2531

benjaminjb avatar Jan 03 '23 19:01 benjaminjb

hey @benjaminjb, are there any updates on this topic? I can't believe that I need to research how to fight against WAL/backups taking all of the storage space when I dont even need backups

MarioMartReq avatar Dec 05 '23 10:12 MarioMartReq