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

question: mountpoint permission #112

Open
lucming opened this issue Nov 6, 2024 · 5 comments
Open

question: mountpoint permission #112

lucming opened this issue Nov 6, 2024 · 5 comments

Comments

@lucming
Copy link

lucming commented Nov 6, 2024

hi, everyone, I'd like to pose a question
A pod (run as a non-root user) that uses storage switched from lvm to ebs, it prompted that there was no write permission. It was found that the permissions of the mount directory of the pod using the lvm plugin is 777 (code: https://github.com/metal-stack/csi-driver-lvm/blob/master/pkg/lvm/lvm.go#L214 ), so any user in the container can read and write. But the permissions of the mount directory of ebs plugin is 755 (code: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/pkg/mounter/mount_linux.go#L272 ), only the root user has write permission. Seeing that the permissions of the mount directories of other csi plugins in the community are mostly 755 or 750, why does the lvm plugin set the permissions of the mount directory to 777?

other storage plugin:
https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/pkg/mounter/mount_linux.go#L272
https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/pkg/driver/mounter.go#L40
other lvm-csi plugin:
https://github.com/wavezhang/k8s-csi-lvm/blob/master/pkg/lvm/nodeserver.go#L116
https://github.com/aleofreddi/csi-sanlock-lvm/blob/master/pkg/driverd/filesystem.go#L213

related pr: kubernetes-sigs/aws-ebs-csi-driver#2207

@lucming
Copy link
Author

lucming commented Nov 6, 2024

PTAL @mwennrich

@majst01
Copy link
Contributor

majst01 commented Nov 8, 2024

Hi @lucming

can you please explain how it was possible to switch from a csi-driver-lvm volume to a ebs volume while the directory stays the same ? By switching the csi, you got a completely new PVC which does not have any relation the the previous one.

Just want to understand you issue more.

@lucming
Copy link
Author

lucming commented Nov 11, 2024

Hi @lucming

can you please explain how it was possible to switch from a csi-driver-lvm volume to a ebs volume while the directory stays the same ? By switching the csi, you got a completely new PVC which does not have any relation the the previous one.

Just want to understand you issue more.

@majst01 thanks for your reply, there are some discussions you might want to check out. kubernetes-sigs/aws-ebs-csi-driver#2211

@lucming
Copy link
Author

lucming commented Nov 11, 2024

I've observed that many storage plugins don't grant 777 permissions. If a pod used the lvm plugin before and then switched to other plugins, it would involve some transformation costs. Should the permissions of the mount directories of the lvm plugin be consistent with other plugins in the community?

@lucming
Copy link
Author

lucming commented Nov 13, 2024

@majst01 PTAL ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants