Postgres pod will be disapear
myaghini opened this issue · 2 comments
Hi,
I have created a postgres pod with persistentvolume and it work realy good and my web-app can make a connection to that. But the postgres pod would be disapear every day (not web-app pod). Have somebody any idea?
Here is my yaml-file:
##########
apiVersion: v1
kind: Pod
metadata:
name: cncl101-pgdbp01
labels:
name: cncl101-pgdbp01
spec:
containers:
- image: launcher.gcr.io/google/postgresql9:latest
name: postgres
env:
- name: "POSTGRES_USER"
value: "xxxxx"
- name: "POSTGRES_PASSWORD"
value: "xxxxxx"
- name: "POSTGRES_DB"
value: "xxxxxx"
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
subPath: data
volumes:
- name: data
persistentVolumeClaim:
claimName: data
##########
I have to say, that I use preemtible node-pool. But the other pod (web-app) dont have any problem and will be created again on another node, if one node is down. Just postgres-Node has this problem (there is no error, it would be disapeared compeletly)
This pod is created manually, i.e. without a deployment
or replicationController
, so it won't survive node failures/pre-emptions. See https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-lifetime