dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
132 stars 28 forks source link

pvc not removed when the Dragonfly instance is deleted. #139

Open Jean-Daniel opened 9 months ago

Jean-Daniel commented 9 months ago

Deleting a DragonFly instance should remove the PVC created by the operator.

If the user has sensible data on it, they should be attached to PV with a persistentVolumeReclaimPolicy: Retain so it should still be safe to delete the PVC.

Step to reproduce:

The operator properly cleanup the StatefulSet, but it does not delete the PVC.

parera10 commented 5 months ago

This is the expected behaviour with statefulsets and persistentVolumeClaimSpec. In the same as you scale up to 4 replicas and then you scale down to 3, the fourth pvc is not deleted and it's reused if you scale up to 4 again.