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

Recovery to PVC restores data in subdirectory instead of root directory #392

Closed
dzolotov opened this issue Mar 24, 2018 · 0 comments
Closed
Labels
Milestone

Comments

@dzolotov
Copy link

The data was successfully backed up from PVC-attached block device, but after restore the files were placed in subdirectory with name, equals to last directory of original path, instead of original location. For example, if the original volume is mounted to /var/lib/grafana (from PVC), after recovery, the data is found in /var/lib/grafana/grafana.

Original restic yaml:

apiVersion: stash.appscode.com/v1alpha1
kind: Restic
metadata:
  namespace: monitoring
  name: kube-prometheus-grafana-restic
spec:
  selector:
    matchLabels:
      app: kube-prometheus-grafana
  fileGroups:
  - path: /var/lib/grafana
    retentionPolicyName: 'keep-last-30'
  backend:
    local:
      mountPath: /repo
      subPath: backups
      nfs:
        server: 10.245.245.10
        path: /
    storageSecretName: kube-prometheus-grafana-secret
  schedule: '@daily'
  volumeMounts:
  - mountPath: /var/lib/grafana
    name: grafana-storage
  retentionPolicies:
  - name: 'keep-last-30'
    keepLast: 30
    prune: true

Recovery YAML:

apiVersion: stash.appscode.com/v1alpha1
kind: Recovery
metadata:
  name: kube-prometheus-grafana
  namespace: monitoring
spec:
  workload:
    kind: Deployment
    name: kube-prometheus-grafana
  backend:
    local:
      mountPath: /repo
      subPath: backups
      nfs:
        server: 10.245.245.10
        path: /
    storageSecretName: kube-prometheus-grafana-secret
  paths:
  - /var/lib/grafana
  recoveredVolumes:
  - mountPath: /var/lib/grafana
    persistentVolumeClaim:
      claimName: kube-prometheus-grafana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants