This PR adds a new variable in the values.yaml file: persistence.retentionPolicy.
This allow users to define which is the PVC retention policy for the created Statefulsets. Kubernetes by default sets a Remain policy, meaning that no PVC are removed when the Statefulset is down-scaled or removed. With this new setting, users can tell Kubernetes to remove these disks, for example for non production environment.
This variable has a default set to {}, meaning that this setting will not be applied and Kubernetes will apply its default value, so current statefulsets will not be affected.
Hello! 👋
This PR adds a new variable in the
values.yaml
file:persistence.retentionPolicy
.This allow users to define which is the PVC retention policy for the created Statefulsets. Kubernetes by default sets a
Remain
policy, meaning that no PVC are removed when the Statefulset is down-scaled or removed. With this new setting, users can tell Kubernetes to remove these disks, for example for non production environment.This variable has a default set to
{}
, meaning that this setting will not be applied and Kubernetes will apply its default value, so current statefulsets will not be affected.More info about this new feature here: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
Some tests
I've run the following commands to ensure that the output is expected:
Using this setting on a K8S cluster below 1.23: Setting do not appear on the rendered statefulset.
Using this setting on a k8s cluster above 1.23: Setting appears on the rendered statefulset.
Using the default value in a k8s cluster above 1.23: Setting do not appear on the rendered statefulset.