apiVersion: v1
kind: Pod
metadata:
  name: postgres
  labels:
    name: postgres
spec:
  containers:
    - name: postgres
      image: postgres
      env:
        - name: PG_USER
          value: postgres
        - name: PG_PASS
          value: password
        - name: PGDATA
          value: /var/lib/pgsql/9.4/data
      ports:
        - containerPort: 5432
      volumeMounts:
        - mountPath: /var/lib/pgsql/9.4/data
          name: pg-data
  volumes:
    - name: pg-data
      persistentVolumeClaim:
        claimName: pg-data-claim
