Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup Rook on PVCs (Block VolumeMode) #1422

Open
MarkusNowotny opened this issue Feb 17, 2022 · 2 comments
Open

Backup Rook on PVCs (Block VolumeMode) #1422

MarkusNowotny opened this issue Feb 17, 2022 · 2 comments

Comments

@MarkusNowotny
Copy link

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

@hossainemruz
Copy link
Contributor

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.

@MarkusNowotny
Copy link
Author

I've changed the securityContext in the RestoreSession but it is not working
rook-ceph-osd-0-744fb7486b-rrh6z_stash-init.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants