-
Notifications
You must be signed in to change notification settings - Fork 3
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
Many non-root deployments fail with permission denied when trying to write to QNAP volumes #16
Comments
@pkerwien (1) |
Thanks! This looks promising. The mariadb-operator now managed to deploy a DB cluster. I will do more testning later. |
@davidcheng0716 All previously failed deployments work now! Can the changes be made during installation of QNAP CSI (to avoid patching) or will this CSI driver change be default in a future release? |
@davidcheng0716 I just discovered that the Longhorn CSI driver uses "ReadWriteOnceWithFSType: Indicates that volumes will be examined to determine if volume ownership and permissions should be modified to match the pod's security policy. Changes will only occur if the fsType is defined and the persistent volume's accessModes contains ReadWriteOnce." In my QNAP storage class, there is no such fsType parameter. Not sure if I can add one or if that would make it work without having to patch the CSIDriver. |
This will fix issue qnap-dev#16. Signed-off-by: Peter Kerwien <[email protected]>
We appreciate your suggestion and will consider setting it as the default in a future version. |
When deploying 3rd party applications like mariadb-operator, cloudnative-pg and bitnami/mariadb helm chart, they all fail when using a PVC on the QNAP NAS.
This happens since the CSI driver is not changing the volume permissions while mounting it when fsGroup is used in the manifests to allow the non-root container user to write to the filesystem.
Using this demo deployment with both Longhorn and QNAP-CSI:
Results in the following when using Longhorn CSI:
$ kubectl exec -it mariadb-6d88bd45c4-kwrmz -- ls -ldn /var/lib/mysql drwxrwsr-x 3 0 999 4096 Sep 1 10:36 /var/lib/mysql
With QNAP-CSI:
PVC:
$ kubectl exec -it mariadb-5576bb9b88-29tbh -- ls -ldn /var/lib/mysql drwxr-xr-x 3 0 0 4096 Sep 2 09:20 /var/lib/mysql
Since the container UID in this example is 999, the user can write to the volume when using Longhorn, but not when using QNAP-CSI.
Another example is using the mariadb-operator to deploy mariadb databases. The database pods will fail with:
Please add necessary fsGroup support into the CSI driver so all these non-root applications can be deployed using QNAP volumes.
My setup is:
My storage class for QNAP PVCs is:
The text was updated successfully, but these errors were encountered: