Backup Rook on PVCs (Block VolumeMode)
Hi,
I've setup up Rook on PVC in Block VolumeMode and Stash Community Edition. I'd like to backup the PVCs that are used by Rook osd. Is it even possible to backup and restore PVCs in Block VolumeMode?
This is my working configuration to backup an osd PVC from Rook.
apiVersion: stash.appscode.com/v1beta1
kind: BackupConfiguration
metadata:
name: rook-ceph-osd-0-backup
namespace: rook-ceph
spec:
driver: Restic
paused: true
repository:
name: s3-repo
retentionPolicy:
keepLast: 5
name: keep-last-5-3
prune: true
runtimeSettings:
container:
securityContext:
runAsUser: 0
schedule: '*/5 * * * *'
target:
paths:
- /source/data
ref:
apiVersion: apps/v1
kind: Deployment
name: rook-ceph-osd-0
volumeMounts:
- mountPath: /source/data
name: set1-data-1bzgdq-bridge
subPath: ceph-0
This is my restore session which is not working
apiVersion: stash.appscode.com/v1beta1
kind: RestoreSession
metadata:
name: deployment-restore
namespace: rook-ceph
spec:
driver: Restic
repository:
name: s3-repo
runtimeSettings: {}
target:
ref:
apiVersion: apps/v1
kind: Deployment
name: rook-ceph-osd-0
rules:
- paths:
- /source/data/
volumeMounts:
- mountPath: /source/data
name: set1-data-1bzgdq-bridge
subPath: ceph-0
task: {}
tempDir: {}
The stash-init container shows an error. See the attached log file for the error rook-ceph-osd-0-557656658b-rfqt2_stash-init.log
I'm confused by the error. Is the pod not starting because the /source/data/block file exists or because of the thrown error.
Maybe one of you can help me to solve this problem.
Thanks
Since, you are running the backup as root user, you have to run RestoreSession as root user too. Use the same runtimeSettings as the BackupConfiguration in the RestoreSession.
I've changed the securityContext in the RestoreSession but it is not working rook-ceph-osd-0-744fb7486b-rrh6z_stash-init.log