apiVersion: batch/v1
kind: Job
metadata:
  name: longhorn-data-restore
  namespace: longhorn-system
spec:
  backoffLimit: 5
  activeDeadlineSeconds: 600
  ttlSecondsAfterFinished: 60
  template:
    spec:
      serviceAccountName: longhorn-data-restore
      containers:
      - name: restore
        imagePullPolicy: Always
        image: wahooli/longhorn-backup-restore:bulk-latest
        env:
        - name: LONGHORN_URL
          value: http://longhorn-frontend.longhorn-system/v1
        - name: NOTIFY_COMPLETE
          value: "true"
        - name: SECRET_NAME
          value: "longhorn-restore-complete"
        volumeMounts:
        - name: config-json
          mountPath: /config/config.json
          subPath: config.json
      restartPolicy: Never
      volumes:
      - name: config-json
        configMap:
          name: longhorn-data-restore-job-config
