Is there any way to decouple the storage from the postgres cluster? #4278
-
I'm currently trying to create a cluster following the defaults laid out in the documentation, but upon testing I found that specifying the storageclass automatically creates the PVC and the PV, but then when I delete it, the PVC and PV also disappears with it. So to prevent this, I specified Retain in the storageclass configuration, but since I'm using Longhorn to manage storage, once you delete a PVC, the previously associated PV turns from Bound to Released, rather than to Available. Right now, for the rest of my application, I have kept the PVC resource defintions separate to the actual services and deployments. This is so that even when I delete an application, the PVC stays around and I can easily restart the application and it will automatically reuse the existing PVC. Is there any way for me to do something similar with CloudNative-PG as well? Or at least make it so that when I delete the cluster, the storage doesn't get deleted with it but is instead kept around and reused if I recreate the cluster from the manifest definition? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @JacksonZ03 Have you tried the hibernate command with the plugin ? Regards, |
Beta Was this translation helpful? Give feedback.
Hi,
Probably you want to take a look here https://cloudnative-pg.io/documentation/current/declarative_hibernation/ which is the declarative way and here https://cloudnative-pg.io/documentation/current/kubectl-plugin/#cluster-hibernation which is the one using the plugin
Regards,