openebs-archive / openebs-docs

OpenEBS Documentation
https://docs.openebs.io
Apache License 2.0
37 stars 137 forks source link

Unable to take a backup of a sample wordpress app using restic in RancherOS with OpenEBS #574

Open ranjithwingrider opened 5 years ago

ranjithwingrider commented 5 years ago

This issue is reported by imran in one of the opensource slack channel. While taking backup I am getting the following error

time="2019-04-03T08:57:22Z" level=info msg="Backup completed with errors: [pod volume backup failed: error getting volume path on host: expected one matching path, got 0, pod volume backup failed: error getting volume path on host: expected one matching path, got 0]" backup=velero/wp-bkp-openebs-1 logSource="pkg/backup/backup.go:297"

k8s version - v1.13.5

velero version
Client:
    Version: v0.11.0
    Git commit: ab2fc65c02ecdcb9bb1690e3afe67a3b3196aebc
Server:
    Version: v0.11.0
ranjithwingrider commented 5 years ago

After debugging this issue, found that the restic pods are not seeing any pod related directories under the /host_pods mount. Its with the setting of the Restic daemonset for Rancher OS. In RancherOS , the path is not /var/lib/kubelet/pods , rather it is /opt/rke/var/lib/kubelet/pods For resolving this issue, need to change the hostpath from "/var/lib/kubelet/pods" to "/opt/rke/var/lib/kubelet/pods" Example snippet:

     volumes:
        - name: cloud-credentials
          secret:
            secretName: cloud-credentials
        - name: host-pods
          hostPath:
            path: /opt/rke/var/lib/kubelet/pods
        - name: scratch