apiVersion: apps/v1
kind: Deployment
metadata:
    name: cvat-db
    namespace: cvat
spec:
    replicas: 1
    selector:
        matchLabels:
            app: cvat-db    
    strategy:
        type: Recreate            
    template:
        metadata:
            labels: 
                app: cvat-db
        spec:
          containers:
          - env:
            - name: POSTGRES_DB
              value: cvat
            - name: POSTGRES_HOST_AUTH_METHOD
              value: trust
            - name: POSTGRES_USER
              value: root
            image: postgres:10-alpine
            name: cvat-db
            ports:
            - containerPort: 5432
            resources: {}
            volumeMounts:
            - mountPath: /var/lib/postgresql/data
              name: cvat-db
          restartPolicy: Always
          volumes:
          - name: cvat-db
            persistentVolumeClaim:
              claimName: cvat-db
status: {}