apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: testbefund
  name: sqldb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: testbefund
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: testbefund
    spec:
      containers:
      - name: sqldb
        image: postgres
        ports:
          - containerPort: 5432
        env:
        - name: POSTGRES_DB
          value: testbefund
        - name: POSTGRES_PASSWORD
          value: postgresql
        - name: POSTGRES_USER
          value: postgresql
        volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: sqldb-data
      restartPolicy: Always
      volumes:
      - name: sqldb-data
        persistentVolumeClaim:
          claimName: sqldb-data
status: {}
