apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: postgres
    appMajor: "12"
    instance: unbscholar.postgres.lib.unb.ca
    tier: database
    uri: unbscholar.postgres.lib.unb.ca
    vcsOwner: unb-libraries
    vcsRepository: unbscholar.postgres.lib.unb.ca
    vcsRef: prod
  name: unbscholar-postgres-lib-unb-ca
  namespace: prod
spec:
  selector:
    matchLabels:
      uri: unbscholar.postgres.lib.unb.ca
  replicas: 1
  revisionHistoryLimit: 0
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: postgres
        appMajor: "12"
        instance: unbscholar.postgres.lib.unb.ca
        tier: database
        uri: unbscholar.postgres.lib.unb.ca
        vcsOwner: unb-libraries
        vcsRepository: unbscholar.postgres.lib.unb.ca
        vcsRef: prod
    spec:
      nodeSelector:
        deployenv: prod
      containers:
        -
          env:
            -
              name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres
                  key: root-password
          image: "||DEPLOYMENTIMAGE||"
          imagePullPolicy: Always
          name: unbscholar-postgres-lib-unb-ca
          ports:
            -
              containerPort: 5432
              name: postgres
          volumeMounts:
            -
              mountPath: /var/lib/postgresql/data
              name: postgres-persistent-storage
      priorityClassName: vip-essential
      imagePullSecrets:
        -
          name: github-container-registry-auth
      restartPolicy: Always
      volumes:
        -
          name: postgres-persistent-storage
          persistentVolumeClaim:
            claimName: unbscholar-postgres-lib-unb-ca
