Open nupplaphil opened 1 year ago
Hello @nupplaphil
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.
Hi @nupplaphil
To further elaborate @poyaz's answer: yes K8up only mounts backups with the read-only volumeMount, as you can see here: https://github.com/k8up-io/k8up/blob/master/operator/backupcontroller/backup_utils.go#L27
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.
Running ausearch -m avc --start recent
indeed shows:
path="/data/db.sqlite3-shm" dev="rbd0" ino=16 scontext=system_u:system_r:container_t:s0:c236,c716 tcontext=system_u:object_r:container_file_t:s0:c359,c809
I think k8up is trying with SELinux level s0:c236,716 to access /data/db.sqlite3-shm which has level s0:c359,c809. Hence the deny.
Customizing the PodSecurityContext fixed the problem for me.
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