Git Product home page Git Product logo

Comments (9)

markusressel avatar markusressel commented on May 18, 2024 6

I have the same problem, @h0tbird any known mitigations?

from local-path-provisioner.

tamalsaha avatar tamalsaha commented on May 18, 2024 2

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.

mqdefault

from local-path-provisioner.

h0tbird avatar h0tbird commented on May 18, 2024 1

Oh! It might be related to kubernetes/kubernetes#81676

from local-path-provisioner.

jamesgoodhouse avatar jamesgoodhouse commented on May 18, 2024

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.

tamalsaha avatar tamalsaha commented on May 18, 2024

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.

tamalsaha avatar tamalsaha commented on May 18, 2024

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.

jamesgoodhouse avatar jamesgoodhouse commented on May 18, 2024

@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.

jamesgoodhouse avatar jamesgoodhouse commented on May 18, 2024

@tamalsaha Great summary, thank you.

from local-path-provisioner.

benzman81 avatar benzman81 commented on May 18, 2024

Just tried Local Path Provisioner v0.0.23 and with the annotation it works (see examples).

from local-path-provisioner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.