Skip to content

Retain PVCs on PostgresCluster delete #3674

Open
@nbrns

Description

@nbrns

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions