You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Longhorn with Wordpress (bitnami image) on my k8s and want to automatically backup the pvc per k8up.
After deploying Wordpress, everything works as expected, I can access /bitnami/wordpress (longhorn mountpoint) inside the pod and the blog is showing up.
Here's a ls -lh on the pod before starting the backup:
$ kubectl exec -n blog -c wordpress blog-wordpress-f8fd65b55-7762s -- ls -lh /bitnamitotal 4.0Kdrwxrwsr-x. 3 1001 1001 4.0K Nov 30 11:29 wordpress$ kubectl exec -n blog -c wordpress blog-wordpress-f8fd65b55-7762s -- ls -lh /bitnami/wordpresstotal 12K-rw-rw----. 1 1001 1001 4.3K Nov 30 11:29 wp-config.phpdrwxrwsr-x. 7 1001 1001 4.0K Nov 30 11:31 wp-content
After starting a Backup job, including the PVC, the Blog becomes unavailable and the /bitnami/wordpress has the same chown as before, but I cannot access it anymore:
$ kubectl exec -n blog -c wordpress blog-wordpress-f8fd65b55-7762s -- ls -lh /bitnamitotal 4.0Kdrwxrwsr-x. 3 1001 1001 4.0K Nov 30 11:29 wordpress$ kubectl exec -n blog -c wordpress blog-wordpress-f8fd65b55-7762s -- ls -lh /bitnami/wordpressls: cannot open directory '/bitnami/wordpress': Permission deniedcommand terminated with exit code 2
It seems like the backup somehow changes the permission on the mountpoint, even if I cannot see it. I don't know how ...
Additional Context
No response
Logs
2023-11-30T21:36:19Z INFO k8up Starting k8up… {"version": "2.7.2", "date": "2023-10-09T10:13:29Z", "commit": "45d99dd90dbb2a080e6832c34e96b371216a3e0b", "go_os": "linux", "go_arch": "amd64", "go_version": "go1.19.13", "uid": 1001, "gid": 0}
2023-11-30T21:36:19Z INFO k8up.restic initializing
2023-11-30T21:36:19Z INFO k8up.restic setting up a signal handler
2023-11-30T21:36:19Z INFO k8up.restic.restic using the following restic options {"options": [""]}
2023-11-30T21:36:19Z INFO k8up.restic.restic.RepoInit.command restic command {"path": "/usr/local/bin/restic", "args": ["init", "--option", ""]}
2023-11-30T21:36:19Z INFO k8up.restic.restic.RepoInit.command Defining RESTIC_PROGRESS_FPS {"frequency": 0.016666666666666666}
2023-11-30T21:36:19Z INFO k8up.restic.restic.unlock unlocking repository {"all": false}
2023-11-30T21:36:19Z INFO k8up.restic.restic.unlock.command restic command {"path": "/usr/local/bin/restic", "args": ["unlock", "--option", ""]}
2023-11-30T21:36:19Z INFO k8up.restic.restic.unlock.command Defining RESTIC_PROGRESS_FPS {"frequency": 0.016666666666666666}
2023-11-30T21:36:20Z INFO k8up.restic.restic.snapshots getting list of snapshots
2023-11-30T21:36:20Z INFO k8up.restic.restic.snapshots.command restic command {"path": "/usr/local/bin/restic", "args": ["snapshots", "--option", "", "--json"]}
2023-11-30T21:36:20Z INFO k8up.restic.restic.snapshots.command Defining RESTIC_PROGRESS_FPS {"frequency": 0.016666666666666666}
2023-11-30T21:36:21Z INFO k8up.restic.k8sClient listing all pods {"annotation": "k8up.io/backupcommand", "namespace": "blog"}
2023-11-30T21:36:21Z INFO k8up.restic backups of annotated jobs have finished successfully
2023-11-30T21:36:21Z INFO k8up.restic.restic.backup starting backup
2023-11-30T21:36:21Z INFO k8up.restic.restic.backup starting backup for folder {"foldername": "blog-wordpress"}
2023-11-30T21:36:21Z INFO k8up.restic.restic.backup.command restic command {"path": "/usr/local/bin/restic", "args": ["backup", "--option", "", "--host", "blog", "--json", "/data/blog-wordpress"]}
2023-11-30T21:36:21Z INFO k8up.restic.restic.backup.command Defining RESTIC_PROGRESS_FPS {"frequency": 0.016666666666666666}
2023-11-30T21:36:22Z ERROR k8up.restic.restic.backup.progress /data/blog-wordpress/lost+found during scan {"error": "error occurred during backup"}
github.com/k8up-io/k8up/v2/restic/logging.(*BackupOutputParser).out
/home/runner/work/k8up/k8up/restic/logging/logging.go:156
github.com/k8up-io/k8up/v2/restic/logging.writer.Write
/home/runner/work/k8up/k8up/restic/logging/logging.go:103
io.copyBuffer
/opt/hostedtoolcache/go/1.19.13/x64/src/io/io.go:429
io.Copy
/opt/hostedtoolcache/go/1.19.13/x64/src/io/io.go:386
os/exec.(*Cmd).writerDescriptor.func1
/opt/hostedtoolcache/go/1.19.13/x64/src/os/exec/exec.go:407
os/exec.(*Cmd).Start.func1
/opt/hostedtoolcache/go/1.19.13/x64/src/os/exec/exec.go:544
2023-11-30T21:36:22Z ERROR k8up.restic.restic.backup.progress /data/blog-wordpress/lost+found during archival {"error": "error occurred during backup"}
github.com/k8up-io/k8up/v2/restic/logging.(*BackupOutputParser).out
/home/runner/work/k8up/k8up/restic/logging/logging.go:156
github.com/k8up-io/k8up/v2/restic/logging.writer.Write
/home/runner/work/k8up/k8up/restic/logging/logging.go:103
io.copyBuffer
/opt/hostedtoolcache/go/1.19.13/x64/src/io/io.go:429
io.Copy
/opt/hostedtoolcache/go/1.19.13/x64/src/io/io.go:386
os/exec.(*Cmd).writerDescriptor.func1
/opt/hostedtoolcache/go/1.19.13/x64/src/os/exec/exec.go:407
os/exec.(*Cmd).Start.func1
/opt/hostedtoolcache/go/1.19.13/x64/src/os/exec/exec.go:544
2023-11-30T21:36:23Z INFO k8up.restic.restic.backup.progress backup finished {"new files": 0, "changed files": 227, "errors": 2}
2023-11-30T21:36:23Z INFO k8up.restic.restic.backup.progress stats {"time": 1.509957467, "bytes added": 121634, "bytes processed": 5386168}
2023-11-30T21:36:23Z INFO k8up.restic.statsHandler.promStats sending prometheus stats {"url": "prometheus-prometheus-pushgateway.prometheus.svc.cluster.local:9091"}
2023-11-30T21:36:23Z INFO k8up.restic.restic.backup.progress restic output {"msg": "Warning: at least one source file could not be read"}
2023-11-30T21:36:23Z INFO k8up.restic.restic.backup backup finished, sending snapshot list
2023-11-30T21:36:23Z INFO k8up.restic.restic.snapshots getting list of snapshots
2023-11-30T21:36:23Z INFO k8up.restic.restic.snapshots.command restic command {"path": "/usr/local/bin/restic", "args": ["snapshots", "--option", "", "--json"]}
2023-11-30T21:36:23Z INFO k8up.restic.restic.snapshots.command Defining RESTIC_PROGRESS_FPS {"frequency": 0.016666666666666666}
Expected Behavior
The Backup job should not make the mountpoint inaccessible for other pods.
As I test k8up, the operator create pod with read-only volumes and mount to the restic backup pod. (In rwo mode k8s don't let mount volume for writing)
Could you share backup pod definition? To realize how volume mounted in backup pod.
This is a read-only flag at the mount stage, so there should be no way that K8up can do any changes to the files in the volume. My guess would be, that maybe Longhorn messes up the permission during the mount or dismount. Unfortunately I've never really used it.
Hi I just ran into the same problem. At my end it looks like this is a SELinux related problem, based on a lot of "avc: denied" errors in the journal. Maybe it's because of the labeling when mounting a volume.
Description
I'm using Longhorn with Wordpress (bitnami image) on my k8s and want to automatically backup the pvc per k8up.
After deploying Wordpress, everything works as expected, I can access
/bitnami/wordpress
(longhorn mountpoint) inside the pod and the blog is showing up.Here's a
ls -lh
on the pod before starting the backup:After starting a
Backup
job, including the PVC, the Blog becomes unavailable and the/bitnami/wordpress
has the same chown as before, but I cannot access it anymore:It seems like the backup somehow changes the permission on the mountpoint, even if I cannot see it. I don't know how ...
Additional Context
No response
Logs
Expected Behavior
The
Backup
job should not make the mountpoint inaccessible for other pods.Steps To Reproduce
StorageClass:
I'm using the k8up Helm Chat with the following
values.yaml
:this is my wordpress pvc:
and my k8up backup:
Version of K8up
v2.7.2
Version of Kubernetes
v1.28.3+k3s2
Distribution of Kubernetes
Rancher k3s
The text was updated successfully, but these errors were encountered: