1. apiVersion: v1
    2. kind: Pod
    3. metadata:
    4. name: restore-to-file
    5. namespace: longhorn-system
    6. spec:
    7. nodeName: <NODE_NAME>
    8. containers:
    9. - name: restore-to-file
    10. command:
    11. # set restore-to-file arguments here
    12. - /bin/sh
    13. - -c
    14. - longhorn backup restore-to-file
    15. '<BACKUP_URL>'
    16. --output-file '/tmp/restore/<OUTPUT_FILE>'
    17. --output-format <OUTPUT_FORMAT>
    18. # the version of longhorn engine should be v0.4.1 or higher
    19. image: longhorn/longhorn-engine:v0.4.1
    20. imagePullPolicy: IfNotPresent
    21. securityContext:
    22. privileged: true
    23. volumeMounts:
    24. - name: disk-directory
    25. mountPath: /tmp/restore # the argument <output-file> should be in this directory
    26. env:
    27. # set Backup Target Credential Secret here.
    28. - name: AWS_ACCESS_KEY_ID
    29. valueFrom:
    30. secretKeyRef:
    31. name: <S3_SECRET_NAME>
    32. key: AWS_ACCESS_KEY_ID
    33. - name: AWS_SECRET_ACCESS_KEY
    34. valueFrom:
    35. secretKeyRef:
    36. name: <S3_SECRET_NAME>
    37. key: AWS_SECRET_ACCESS_KEY
    38. - name: AWS_ENDPOINTS
    39. valueFrom:
    40. secretKeyRef:
    41. name: <S3_SECRET_NAME>
    42. key: AWS_ENDPOINTS
    43. volumes:
    44. # the output file can be found on this host path
    45. - name: disk-directory
    46. hostPath:
    47. path: /tmp/restore
    48. restartPolicy: Never