kubernetes-csi / csi-driver-smb

This driver allows Kubernetes to access SMB Server on both Linux and Windows nodes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After upgrading from 1.6.0 to 1.7.0 via the helm chart volumes are failing to create

PurpleBooth opened this issue · comments

What happened:

After upgrading from 1.6.0 to 1.7.0 via the helm chart volumes are failing to create

Volumes now reporting "failed to provision volume with StorageClass "slow-cheap-rwx": rpc error: code = InvalidArgument desc = invalid parameter csi.storage.k8s.io/pv/name in storage class"

What you expected to happen:

Volumes to continue to be creatable

How to reproduce it:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: slow-cheap-rwx
provisioner: smb.csi.k8s.io
parameters:
  source: //example.com/someshare
  csi.storage.k8s.io/provisioner-secret-name: csi-provisioner
  csi.storage.k8s.io/provisioner-secret-namespace: kube-system
  csi.storage.k8s.io/node-stage-secret-name: csi-node-stage
  csi.storage.k8s.io/node-stage-secret-namespace: kube-system
volumeBindingMode: Immediate
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=568
- gid=568

Then create a PVC

Anything else we need to know?:

Bit of context from the logs

I0630 04:44:54.744723       1 controller.go:1075] Final error received, removing PVC 8ef2b74d-7650-4ed6-9170-4e747812e528 from claims in progress
W0630 04:44:54.744739       1 controller.go:934] Retrying syncing claim "8ef2b74d-7650-4ed6-9170-4e747812e528", failure 12
E0630 04:44:54.744754       1 controller.go:957] error syncing claim "8ef2b74d-7650-4ed6-9170-4e747812e528": failed to provision volume with StorageClass "slow-cheap-rwx": rpc error: code = InvalidArgument desc = invalid parameter csi.storage.k8s.io/pvc/name in storage class
I0630 04:44:54.744768       1 event.go:285] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"media-server", Name:"something", UID:"8ef2b74d-7650-4ed6-9170-4e747812e528", APIVersion:"v1", ResourceVersion:"135543", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "slow-cheap-rwx": rpc error: code = InvalidArgument desc = invalid parameter csi.storage.k8s.io/pvc/name in storage class
Log

Environment:

  • CSI Driver version: 1.7.0
  • Kubernetes version (use kubectl version): Client Version: v1.24.2, Kustomize Version: v4.5.4, Server Version: v1.24.2
  • OS (e.g. from /etc/os-release): Ubuntu 22.04 LTS
  • Kernel (e.g. uname -a): Linux easy-sheepdog-worker-2 5.15.0-39-generic #42-Ubuntu SMP Thu Jun 9 23:42:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools: Helm
  • Others:

remove following config in csi driver controller should work, I think you are using master branch config, following config is not in v1.7.0 deployment now:

- "--extra-create-metadata=true"

this is the v1.7.0 config:

- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.1.0
args:
- "-v=2"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
- "--leader-election-namespace=kube-system"

This was it. I was using a CRD to install the application via helm. I was using the following setup.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: csi-driver-smb
  namespace: argocd
spec:
  project: base
  source:
    chart: csi-driver-smb
    targetRevision: v1.7.0
    repoURL: https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
    helm:
      releaseName: csi-driver-smb
  destination:
    server: https://kubernetes.default.svc
    namespace: kube-system
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true
    - PrunePropagationPolicy=foreground

Turns out the "v" in there default it to latest. 🤦‍♀️