Closed ghkdqhrbals closed 7 months ago
As @rbq suggest in https://github.com/docker-library/postgres/issues/263#issuecomment-460998040, add PGDATA
environment path to solve this issue!
apiVersion: apps/v1
kind: Deployment
metadata:
name: db-deployment
spec:
replicas: 1
selector:
matchLabels:
app: benchmark-db
template:
metadata:
labels:
app: benchmark-db
spec:
containers:
...
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata # inform postgresql to connect dataset with this directory
...
First our PV, PVC, DB connection setting yaml is bellow.
I use gcp persistant disk.
So it looks fine but when I remove db-pod, all data is removed :(