---
apiVersion: v1
kind: Pod
metadata:
  name: {{ ansible_operator_meta.name }}-backup-manager
  namespace: {{ backup_pvc_namespace }}
  labels:
    app.kubernetes.io/name: '{{ deployment_type }}-backup-manager'
    app.kubernetes.io/instance: '{{ deployment_type }}-backup-manager-{{ ansible_operator_meta.name }}'
    app.kubernetes.io/component: backup-manager
    app.kubernetes.io/part-of: '{{ deployment_type }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
spec:
  containers:
  - name: {{ ansible_operator_meta.name }}-backup-manager
    image: "{{ _postgres_image }}"
    imagePullPolicy: Always
    command: ["sleep", "infinity"]
    volumeMounts:
    - name: {{ ansible_operator_meta.name }}-backup
      mountPath: /backups
      readOnly: false
{% if storage_claim is defined %}
    - name: file-storage
      readOnly: false
      mountPath: "/var/lib/pulp"
{% endif %}
  volumes:
    - name: {{ ansible_operator_meta.name }}-backup
      persistentVolumeClaim:
        claimName: {{ backup_claim }}
        readOnly: false
{% if storage_claim is defined %}
    - name: file-storage
      persistentVolumeClaim:
        claimName: {{ storage_claim }}
{% endif %}
  restartPolicy: Never
