---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: ovh-checker-<ENV>-postgres
spec:
  selector:
    matchLabels:
      app: ovh-checker-<ENV>-postgres
  serviceName: ovh-checker-<ENV>-postgres
  template:
    metadata:
      labels:
        app: ovh-checker-<ENV>-postgres
    spec:
      containers:
        - name: postgres
          image: postgres:9.6
          env:
            - name: POSTGRES_DB
              value: ovh
            - name: POSTGRES_HOST_AUTH_METHOD
              value: trust
            - name: POSTGRES_USER
              value: root
          ports:
            - containerPort: 5432
          volumeMounts:
            - name: data
              mountPath: /var/lib/postgresql/data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: ovh-checker-<ENV>-postgres
