I have the following configuration
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: postgres-pvc-v1 # Sets name of PVC labels: app: postgres spec: storageClassName: do-block-storage accessModes: - ReadWriteOnce # Sets read and write access resources: requests: storage: 10Gi # Sets volume size --- apiVersion: apps/v1 kind: Deployment metadata: name: postgres spec: replicas: 1 selector: matchLabels: app: postgres template: metadata: labels: app: postgres spec: containers: - name: postgres image: postgis/postgis # Sets Image imagePullPolicy: "IfNotPresent" ports: - containerPort: 5432 # Exposes container port envFrom: - configMapRef: name: postgres-cfg volumeMounts: - mountPath: /var/lib/postgresql/data name: postgredb volumes: - name: postgredb persistentVolumeClaim: claimName: postgres-pvc-v1 ---
but in the pod log I have the following error
Data page checksums are disabled. initdb: error: directory "/var/lib/postgresql/data" exists but is not empty initdb: detail: It contains a lost+found directory, perhaps due to it being a mount point. initdb: hint: Using a mount point directly as the data directory is not recommended. Create a subdirectory under the mount point.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.