Comments (9)
I have the same problem, @h0tbird any known mitigations?
from local-path-provisioner.
End users can't do anything here.
https://github.com/rancher/local-path-provisioner/blob/master/provisioner.go#L225-L260
As you can see here, local-path provisioner just creates a hostPath
type PV.
https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/hostpath/host_path.go#L228-L244
hostPath
PV implementation does not do anything with fsGroup
.
Compare this to the emptyDir
PV, where ownership is set properly.
https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/emptydir/empty_dir.go#L282
So, one solution (I think the only practical/realistic solution) will be to use a CSI driver which has fsGroup
support https://kubernetes-csi.github.io/docs/support-fsgroup.html
There is a non-prod quality CSI driver https://github.com/kubernetes-csi/csi-driver-host-path . And there is no plan to make it prod quality kubernetes-csi/csi-driver-host-path#239 .
There is an alternative solution https://github.com/topolvm/topolvm . But this uses LVM underneath which might be more than what we need for simple use-cases.
from local-path-provisioner.
Oh! It might be related to kubernetes/kubernetes#81676
from local-path-provisioner.
Is this different than this issue #7? Seems like it was fixed, but I'm also having problems getting fsGroup to be respected when mounting a volume.
from local-path-provisioner.
I think when #7 was fixed there was no concept of fsGroup
. I think the fix that is needed is
https://github.com/rancher/local-path-provisioner/blob/master/deploy/local-path-storage.yaml#L128
After the directory is created, there needs to be a chgrp -R $fsGroup ${absolutePath}
command to fix this.
Also invoked from here: https://github.com/rancher/local-path-provisioner/blob/master/provisioner.go#L209-L213
from local-path-provisioner.
After further investigation, I think that this can't be fixed by rancher local-path provisioner. The underlying issue is that hostPath
PVs do not support fsGroup. So, there is nothing rancher provisioner can do as long as it uses hostPath
PV.
A good solution here will be to use CSI driver for local path that can set fsGroup properly during the mount process.
from local-path-provisioner.
@tamalsaha Is using the CSI driver for local path a change required in the local-path-provisioner
, or something that can be done by the end user?
from local-path-provisioner.
@tamalsaha Great summary, thank you.
from local-path-provisioner.
Just tried Local Path Provisioner v0.0.23 and with the annotation it works (see examples).
from local-path-provisioner.
Related Issues (20)
- Feature request: monitoring volume usage HOT 2
- CSI Volume Cloning HOT 2
- how to create xfs formatted disks with this? HOT 3
- when create PVC, some of the pv are 755 permission HOT 1
- Not able to use instance created with aws bottlerocket image for local storage
- Possibility to change affinity rules HOT 3
- ProvisioningFailed due to mkdir: can't create directory '': No such file or directory HOT 1
- SELinux blocking disk operations on a hostPath volume HOT 5
- busybox 1.36.1 Illegal option -a HOT 1
- Can we update go version to 1.20.5 and publish to docker hub? HOT 3
- E2E test failing due to conflicting PersistentVolume with previous test when volume type is "local"
- [question]: Is `fsGroup` working with `ReadWriteMany` PV?
- volume folder created with unexpected different user and folder HOT 3
- Should support anti afinity policy settings on pvc
- Pod with nodeName hangs while waiting for PVC to be provisioned HOT 2
- feature: add support to set folderName on PVC HOT 4
- Volume not provisioned when binding type is set to `Immediate` HOT 3
- Helm: Chart.yaml file is missing on helm install
- StorageClass annotations defaultVolumeType not work HOT 7
- Helm chart contains duplicate labels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local-path-provisioner.