Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain PVCs on PostgresCluster delete #3674

Open
nbrns opened this issue Jun 20, 2023 · 4 comments
Open

Retain PVCs on PostgresCluster delete #3674

nbrns opened this issue Jun 20, 2023 · 4 comments

Comments

@nbrns
Copy link

nbrns commented Jun 20, 2023

Overview

When deleting a PostgresCluster CRD, the operator also deletes it's PVCs. I'd love to see a configuration option on the operator/cluster CRD that allows us to retain the PVC and the attached PV.

I know there is a guide to retain the PVs by doing some manual patching. However, it is cumbersome to reattach the PVs to a new Cluster, especially in a fully automated scenario. Newly provisioned persistent volumes claim do not work well with label selectors (e.g. dynamic provisioning with selector labels is not supported on AKS and EKS).

Use Case

  • Easier recovery by mounting existing PVCs to StatefulSet deployed by the operator instead of having to reattach PVs to PVCs
  • Many operators keep the PVCs by default, i.e. they do not prune the data upon CRD deletion. This is more intuitive in my opinion

Desired Behavior

A configuration option on either the operator or the PostgresCluster CRD, that allows to retain PVCs on PostgresCluster deletion. E.g. retainPvcs: true

Environment

Tell us about your environment:

Please provide the following details:

  • Platform: AKS
  • Platform Version: 1.26.3
  • PGO Image Tag: (e.g. ubi8-5.3.1-0)
  • Postgres Version (e.g. 15)
  • Storage: (e.g. hostpath, nfs, or the name of your storage class)
  • Number of Postgres clusters: 2

Additional Information

NA

@tjmoore4 tjmoore4 added the v5 label Jun 22, 2023
@tjmoore4
Copy link
Contributor

Hello @nbrns. Thank you for your use-case information. I've added a note about this feature request to our backlog for future development. Regarding your specific scenario, do I understand correctly that you always keep all associated PVCs or do you only need to retain a subset of them?

@nbrns
Copy link
Author

nbrns commented Jun 22, 2023

Thanks for noting our use case!

I would like to keep all PVCs associated to a Postgres Cluster and its respective StatefulSets

@tjmoore4
Copy link
Contributor

Understood, thanks! I've updated our backlog accordingly.

@szelenka
Copy link
Contributor

szelenka commented Aug 7, 2023

This would be a very welcome addition, similar to #3654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants