apiVersion: v1
kind: Pod
metadata:
  name: mainflux-postgres
  labels:
    name: mainflux-postgres
spec:
  containers:
    - name: mainflux-postgres
      image: postgres:10.2-alpine
      env:
        - name: POSTGRES_USER
          value: "mainflux"
        - name: POSTGRES_PASSWORD
          value: "mainflux"
        - name: POSTGRES_DB
          value: "mainflux"
        - name: PGDATA
          value: /var/lib/postgresql/data/mainflux-postgres-data
      ports:
        - containerPort: 5432
      volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: mainflux-postgres-data
  volumes:
    - name: mainflux-postgres-data
      persistentVolumeClaim:
        claimName: mainflux-postgres-data-claim