-
Notifications
You must be signed in to change notification settings - Fork 190
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
[BUG] Create a pvc backuprepo, but got permission denied #6927
Comments
It appears that our pre-check job lacks the permissions to write to the volume. Could you please follow the steps below to reproduce the issue?
kubectl apply -f - <<-EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-cephfs
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: shared-nvme
volumeMode: Filesystem
EOF
kubectl apply -f - <<"EOF"
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: mounter
image: ubuntu:24.04
command: ["/bin/bash", "-c"]
args:
- |
echo hello > /data/hello.txt
cat /data/hello.txt
volumeMounts:
- mountPath: /data
name: data
volumes:
- name: data
persistentVolumeClaim:
claimName: test-cephfs
EOF
kubectl logs test-pod -f If the above steps can reproduce the issue, I suspect that there might be an issue with your ceph-csi-cephfs configuration. |
$ kubectl logs test-pod -f
hello @zjx20 It's working properly. |
I replace test pod image to $ kubectl logs -f test-pod2
/bin/sh: can't create /data/hello.txt: Permission denied
hello |
$ id
uid=65532 gid=0(root) groups=0(root) uid is 65532 in the image |
Perhaps it need to set this uid 0 when running pre-check pod securityContext:
runAsUser: 0 |
Thank you for providing this, I will make a fix. However, there is no quick workaround for the current version (v0.8.2), so you have to wait for the next release for the fix, sorry for the inconvenience. |
For a workaround:
$ cat << 'EOF' > Dockerfile
FROM infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:0.8.2
User root
EOF
$ docker build -t ghcr.io/wutz/kubeblocks-tools:0.8.2 .
$ docker push ghcr.io/wutz/kubeblocks-tools:0.8.2
|
Describe the bug
A pvc backuprepo was created, but the pre-check permission was denied.
To Reproduce
Steps to reproduce the behavior:
shared-nvme
which deployment by ceph-csi-cephfskbcli backuprepo create --provider pvc --storage-class-name "shared-nvme" --access-mode "ReadWriteMany" --volume-capacity "1Ti" --default
Expected behavior
The backuprepo is created successfully.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: