apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres-deployment        
  labels: 
    app: postgres
spec:
  replicas: 1
  selector:
    matchLabels: 
      app: postgres
  template: 
    metadata:
      labels:
        app: postgres
    spec:
      containers:
      - name: postgres
        image: postgres
        env:
        - name: POSTGRES_DB
          value: <some_postgres_db_name>
        - name: POSTGRES_USER
          value: <some_postgres_db_user>
        - name: POSTGRES_PASSWORD
          value: <some_postgres_db_password>
        ports:
        - containerPort: 5432
        volumeMounts:
        - name: postgres-volume
          mountPath: /var/lib/postgresql/data
      volumes:
        - name: postgres-volume
          persistentVolumeClaim:
            claimName: concourse-db-pvc
