csi-driver-smb icon indicating copy to clipboard operation
csi-driver-smb copied to clipboard

MountOptions declared in storageClass don't seem to work (they work if declared in a manually created PV)

Open igor-msk opened this issue 1 year ago • 3 comments

MountOptions declared in StorageClass don't seem to apply

apiVersion: storage.k8s.io/v1
kind: StorageClass
...
mountOptions:
  - noperm
  - noserverino

What happened: the PVC got created but remained in Pending state with the following error - Warning ProvisioningFailed 1s (x2 over 2s) smb.csi.k8s.io_dev-kuber-node-pool-cpu-3l215_8522d1a0-224f-4c17-9bf7-07ed1b0e8161 failed to provision volume with StorageClass "smb-sbf-it-cam-dockerwebservice": rpc error: code = Internal desc = failed to mount smb server: rpc error: code = Internal desc = MkdirAll /tmp/pvc-6a28c399-6f67-4d2d-a7d5-c07d423b954e failed with error: mkdir /tmp/pvc-6a28c399-6f67-4d2d-a7d5-c07d423b954e: read-only file system

What you expected to happen: SMB successfully mounted. I got it to work only by manually creating a PV and declaring the MountOptions in the PV nstread of declaring them in the StorageClass, but I need many PVs in subdirs with PVC names, so providing PVs with montOptions manually is not an option.

How to reproduce it: Try Option 1 - use a SatefullSet with a StorageClass without manually creating PVs

Environment:

  • CSI Driver version: csi-provisioner:v4.0.0

  • Kubernetes version (use kubectl version): Server Version: version.Info{Major:"1", Minor:"28+", GitVersion:"v1.28.3-r0-28.0.21.7", GitCommit:"db59dc8d4317f42fd5dd69f42dcd73088b83db13", GitTreeState:"clean", BuildDate:"2024-03-05T06:44:38Z", GoVersion:"go1.20.12", Compiler:"gc", Platform:"linux/amd64"}

  • OS (e.g. from /etc/os-release):

CentOS Linux 7 (Core)
3.10.0-1160.92.1.el7.x86_64
v1.28.3-r0-28.0.13.2   
containerd://1.6.14-75-g6755e9cd6

SMB folders are on Windows host

igor-msk avatar Jul 11 '24 23:07 igor-msk