By fabiokruger
It seems the default provisioner in the StorageClass does not honour the mountOptions values. I tried to mount a block storage setting dir and file mode to 0777 and they were mounted with root only permissions. I need to change write permission because my containers run nginx which runs as root www-data. A workaround is to manually change the directory permission via chmod (either when the container starts with the command + args directives or directly logging in into the container).
Here’s my StorageClass and the PersistentVolumeClaims:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: storage-rw
mountOptions:
- dir_mode=0777
- file_mode=0777
provisioner: dobs.csi.digitalocean.com
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: backend
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Ti
storageClassName: storage-rw
---
Note: in azure aks with a storage account paired to the kubernetes shadow resource group and a similar configuration (changing only StorageClass.provisioner: kubernetes.io/azure-file and PersistentVolumeClaim.spec.accessModes: ReadWriteMany) allows me to create dynamic volumes with the correct file permissions.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This is not the only post on this question and, 3 years later, the question is still ignored. I actually have been paying them for 3 years; might as well bite the bullet and head to AWS. Yuck.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.