Azure / aksArc

# Welcome to the Azure Kubernetes Service enabled by Azure Arc (AKS Arc) repo This is where the AKS Arc team will track features and issues with AKS Arc. We will monitor this repo in order to engage with our community and discuss questions, customer scenarios, or feature requests. Checkout our projects tab to see the roadmap for AKS Arc!
MIT License
111 stars 45 forks source link

[BUG] Parameter "createSubDir" for SMB CSI StorageClass is invalid #278

Open johnliu55-msft opened 1 year ago

johnliu55-msft commented 1 year ago

Describe the bug The official document Use Container Storage Interface (CSI) file drivers in AKS hybrid specifies when creating the StorageClass, an optional parameter createSubDir can be provided to choose whether to create a sub dir for new volume.

image

But with this StorageClass manifest, the PVC using this StorageClass will fail to provision:

kubectl get events
2s          Normal    Provisioning            persistentvolumeclaim/pvc-akshci-smb-csi                    External provisioner is provisioning volume for claim "default/pvc-akshci-smb-csi"
2s          Warning   ProvisioningFailed      persistentvolumeclaim/pvc-akshci-smb-csi                    failed to provision volume with StorageClass "smb-csi": rpc error: code = InvalidArgument desc = invalid parameter createSubDir in storage class

If I remove the parameter createSubDir from the StorageClass manifest, the PVC will be created without any error or warning.

To Reproduce Steps to reproduce the behavior:

  1. Follow the official document to create the SMB CSI StorageClass
  2. Create a PVC using the following YAML:
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
     name: pvc-akshci-csi
    spec:
     accessModes:
     - ReadWriteOnce
     resources:
      requests:
       storage: 10Gi
  3. Use kubectl get events to see the event
  4. The provisioning of the PVC failed with message: failed to provision volume with StorageClass "smb-csi": rpc error: code = InvalidArgument desc = invalid parameter createSubDir in storage class

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

Collect log files

plumbery commented 1 year ago

Hi, the same issue on my Stack HCI. AKS Any updates on this?

apluchik commented 1 year ago

Hi, the createSubDir parameter is now deprecated and removed since the May version of AksHci. The documentation will be updated to reflect this.

If you are upgrading from an older version of AksHci and hit an issue due to createSubDir being used, please recreate the storageClass without the createSubDir parameter as stated in: https://learn.microsoft.com/en-us/azure/aks/hybrid/known-issues-storage#storage-pod-crashes-and-the-logs-say-that-the--createsubdir--parameter-is-invalid

plumbery commented 1 year ago

Hi @apluchik i remove createSubDir: "false" # optional: create a sub dir for new volume line in parameters and pvc bounded. Thanks for your support.

example;

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: smb-csi
provisioner: smb.csi.akshci.com
parameters:
   source: \\smb-server\share
   csi.storage.k8s.io/node-stage-secret-name: "smbcreds"
   csi.storage.k8s.io/node-stage-secret-namespace: "default"
reclaimPolicy: Retain  # only Retain is supported
volumeBindingMode: Immediate
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1001
  - gid=1001