Look at the helm chart file:
https://github.com/helm/charts/blob/master/stable/postgresql/templates/statefulset.yaml
It is evident that if you don't specify the value for .Values.persistence.existingClaim
in values.yaml, it will automatically create a persistent volume claim.
- If you have a storage calss set for
.Values.persistence.storageClass
the created pvc will use that class to provision volumes.
- If you set the storage class as "-", the dynamic provisioning will be disabled.
- If you don't specify anything for
.Values.persistence.storageClass
, the automatically created pvc will not have a storage class field specified.
Since you are using the default values.yaml of the chart, you have the third case.
In kubernetes, if you don't specify a storage class in a persistent volume claim, it will use the default storage class of the cluster to provision volumes.
Check which is your cluster's stoage class:
kubectl get sc
The default StorageClass will be marked by (default)
.
Describe that storage class and find it's Reclaim Policy
.
If the Reclaim Policy is Delete, the pv created by it will be automatically deleted when it's claim is removed (In your case, when the chart is uninstalled).
If the default storage class's Reclaim Policy is not Delete, you have to create your own storage class with Delete policy and then use it further.
rm -rf
on the cluster – Carmine