apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: db
  name: db
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: db
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.kompose.service: db
    spec:
      containers:
      - env:
        - name: PGDATA
          value: /var/lib/postgresql/data/pgdata
        - name: POSTGRES_DB
          value: pycsw
        - name: POSTGRES_PASSWORD
          value: mypass
        - name: POSTGRES_USER
          value: postgres
        image: postgis/postgis:12-3.0-alpine
        name: db
        ports:
        - containerPort: 5432
        resources: {}
        volumeMounts:
        - mountPath: /var/lib/postgresql/data/pgdata
          name: db-data
      restartPolicy: Always
      volumes:
      - name: db-data
        persistentVolumeClaim:
          claimName: db-data
status: {}
