---
apiVersion: v1
kind: Pod
metadata:
  name: {{ meta.name }}-db-management
  namespace: {{ backup_pvc_namespace }}
  labels:
    app.kubernetes.io/name: '{{ meta.name }}'
    app.kubernetes.io/part-of: '{{ meta.name }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
    app.kubernetes.io/component: '{{ deployment_type }}'
    app.kubernetes.io/operator-version: '{{ lookup("env", "OPERATOR_VERSION") }}'
spec:
  containers:
  - name: {{ meta.name }}-db-management
    image: "{{ postgres_image }}:{{ postgres_image_version }}"
    imagePullPolicy: Always
    command: ["sleep", "infinity"]
    volumeMounts:
    - name: {{ meta.name }}-backup
      mountPath: /backups
      readOnly: false
  volumes:
    - name: {{ meta.name }}-backup
      persistentVolumeClaim:
        claimName: {{ backup_claim }}
        readOnly: false
  restartPolicy: Never
