mariadb-operator/mariadb-operator

[Feature] Delete PersistentVolumeClaims

Opened this issue · 3 comments

When deleting a mariadb resource, the operator should delete all PersistentVolumeClaims

Hey! I think we should rely on the StatefulSet for doing this:
https://kubernetes.io/blog/2023/05/04/kubernetes-1-27-statefulset-pvc-auto-deletion-beta/

This is still in beta though

Hey, thanks for pointing me to this feature.
Sadly, I did not find a way to set persistentVolumeClaimRetentionPolicy for the StatefulSet via the Mariadb CRD.

@benedikt-bartscher it is not supported in MariaDB yet, the question is whether we should stick to the StatefulSet API, which is not GA yet, or alternatively come up with our own API to be supported in multiple CRDs. For example:

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
spec:
  cleanupPolicy: (Delete|Skip)