-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
azure_file volumes should allow setting of dir_mode and file_mode #37005
Comments
This is a big requirement, using an azure file volume for postgresql for instance fails due to permissions as initdb tries to change the permissions to be less restrictive but is unable to. |
Evaluating compatibility between a certain setup of a volume mount and an arbitrary piece of software would be the responsibility of the integrator, wouldn't it? It seems a big requirement for K8s itself to have to ensure PostgreSQL can do what it wants. An integrator who tries to use Azure File Storage for PostgreSQL should know better to mount with the correct permission. |
The point is that you cannot mount with permissions, they're hard coded to 0777. |
Ah. Yeah. Sorry for misunderstanding the comment above. Let's say it is an "important" requirement :) |
…ting azure file volume in pod
/sig azure |
/assign andyzhangx |
@justinwyer
|
Automatic merge from submit-queue (batch tested with PRs 55254, 55525, 50108, 54674, 55263). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. support mount options in azure file **What this PR does / why we need it**: support mount options in azure file **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #37005, #54610 **Special notes for your reviewer**: @rootfs @karataliu @feiskyer By default, the dir_mode and file_mode would be 0700, vers would be 3.0, while if user specify `dir_mode`, `file_mode`, `vers` in storage class in `mountOptions` field(see below), then azure file should use user specified mount options. ``` --- kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: azurefile provisioner: kubernetes.io/azure-file mountOptions: - dir_mode=0377 - file_mode=0350 - vers=2.1 parameters: skuName: Standard_LRS location: westus2 ``` **Release note**: ``` support mount options in azure file ``` /sig azure
@andyzhangx Has this change made it into any release yet? I can't seem to find it... Or was the issue resolved in some other way? I'm facing the issue you originally reported, i.e. using a pod volume to an azureFile, and it always mounting with file_mode and dir_mode of 0755... and I need it to be 0777. Is there a workaround? TIA. |
@adysart78 azure file mountOptions feature is available from v1.8.5, here is the example : https://github.com/andyzhangx/demo/blob/master/linux/azurefile/azurefile-mountoptions.md |
Thanks @andyzhangx -- I was still having trouble until I added the storageClassName: "" to the claim... then realized I was hitting issue #44370... which I can avoid by setting storageClassName: "default" to both the pv and pvc, and now everything works. Thanks again! |
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): no
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): azurefile azure_file 0777
Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST
Kubernetes version (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.5", GitCommit:"5a0a696437ad35c133c0c8493f7e9d22b0f9b81b", GitTreeState:"clean", BuildDate:"2016-10-29T01:38:40Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.5", GitCommit:"5a0a696437ad35c133c0c8493f7e9d22b0f9b81b", GitTreeState:"clean", BuildDate:"2016-10-29T01:32:42Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Environment:
uname -a
): Linux 4.4.0-28-generic Some documentation tweaks #47-Ubuntu SMP Fri Jun 24 10:09:13 UTC 2016 x86_64 x86_64 x86_64 GNU/LinuxWhat happened:
I attempted to set up an Azure File Volume using the built-in volume type azureFile. Everything works, except that the files and directories defaults to permission 0777, always.
When I tried to manually mount within the container, I could customise dir_mode and file_mode, meaning that this change should be possible. Reading the source code confirms it - dir_mode=0777 and file_mode=0777 seem hardcoded.
What you expected to happen:
Being able to supply dir_mode and file_mode to the mount. e.g.
How to reproduce it (as minimally and precisely as possible):
N/A. This is a feature request.
Anything else do we need to know:
N/A
The text was updated successfully, but these errors were encountered: