i got a configuration of a postgres deployment, something like this..
on the volumeMounts level
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres-persistance-storage-new
on the volumes level
volumes:
- name: postgres-persistance-storage-new
persistentVolumeClaim:
claimName: postgres-pv-claim-new
the PersistentVolumeClaim spec
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pv-claim-new # name of PVC essential for identifying the storage data
labels:
app: postgres
tier: database
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
My problem is the following : when i delete persistentVolumeClaim via a kubectl command, and then launch again my postgres deployment yaml spec, the persistentVolume seems to be always here, as logs in postgres container say :
PostgreSQL Database directory appears to contain a database; Skipping initialization
How is it possible ?