Skip to content

Can't use storage-class more than ones. #385

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

Closed
vitaliy-leschenko opened this issue Nov 29, 2021 · 3 comments · Fixed by kubernetes-csi/csi-proxy#210
Closed

Can't use storage-class more than ones. #385

vitaliy-leschenko opened this issue Nov 29, 2021 · 3 comments · Fixed by kubernetes-csi/csi-proxy#210
Labels
triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@vitaliy-leschenko
Copy link
Contributor

What happened:
Pods that use csi-driver-smb PVC when we have another PVC that connected to the same smb share.

What you expected to happen:
Possibility to use the same smb server in multiple PV/PVC

How to reproduce it:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: smb
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=1001
- gid=1001
parameters:
  csi.storage.k8s.io/node-stage-secret-name: smbcreds
  csi.storage.k8s.io/node-stage-secret-namespace: default
  csi.storage.k8s.io/provisioner-secret-name: smbcreds
  csi.storage.k8s.io/provisioner-secret-namespace: default
  source: //filestorage.domain.local/sharename
provisioner: smb.csi.k8s.io
reclaimPolicy: Retain
volumeBindingMode: Immediate
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-smb-1
  annotations:
    volume.beta.kubernetes.io/storage-class: smb
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: "smb"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-smb-2
  annotations:
    volume.beta.kubernetes.io/storage-class: smb
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: "smb"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: smb-demo-windows-1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: smb-demo-windows-1
  template:
    metadata:
      labels:
        app: smb-demo-windows-1
    spec:
      nodeSelector:
        "kubernetes.io/os": windows
      containers:
      - name: windows
        image: mcr.microsoft.com/windows/nanoserver:ltsc2022
        command:
        - ping 
        - -t
        - localhost
        volumeMounts:
        - name: smb
          mountPath: "/mnt/smb"
      volumes:
      - name: smb
        persistentVolumeClaim:
          claimName: pvc-smb-1
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: smb-demo-windows-2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: smb-demo-windows-2
  template:
    metadata:
      labels:
        app: smb-demo-windows-2
    spec:
      nodeSelector:
        "kubernetes.io/os": windows
      containers:
      - name: windows
        image: mcr.microsoft.com/windows/nanoserver:ltsc2022
        command:
        - ping 
        - -t
        - localhost
        volumeMounts:
        - name: smb
          mountPath: "/mnt/smb"
      volumes:
      - name: smb
        persistentVolumeClaim:
          claimName: pvc-smb-2

Anything else we need to know?:
csi-proxy.log:

Log file created at: 2021/11/29 17:19:26
Running on machine: k8s-windows-3
Binary: Built with gc go1.13.8 for windows/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I1129 17:19:26.906937    2296 main.go:124] Running as a Windows service.
I1129 17:19:26.907960    2296 main.go:134] Windows Service initialized through SCM
I1129 17:19:26.915680    2296 main.go:54] Starting CSI-Proxy Server ...
I1129 17:19:26.915680    2296 main.go:55] Version: v1.0.2-0-g51a6f06
E1129 17:35:20.185985    2296 server.go:72] failed NewSmbGlobalMapping NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : Multiple connections to a server or shared resource by the same user, using more than one user \r\nname, are not allowed. Disconnect all previous connections to the server or shared resource and try again. \r\nAt line:1 char:190\r\n+ ... ser, $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n   pping], CimException\r\n    + FullyQualifiedErrorId : Windows System Error 1219,New-SmbGlobalMapping\r\n \r\n", err: exit status 1

Environment:

  • CSI Driver version: 1.4.0
  • Kubernetes version (use kubectl version): 1.22.2
  • OS (e.g. from /etc/os-release): Windows Server 2022
  • Others: CRI-containerD 1.6.0.beta.1
@andyzhangx
Copy link
Member

pls only use one PVC for same file share on Windows, there is a limitation on windows, find details here: #219

@andyzhangx andyzhangx added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Nov 30, 2021
@vitaliy-leschenko
Copy link
Contributor Author

So, as I understand we have no reason to use storage classes because it may be used only once.

@andyzhangx
Copy link
Member

So, as I understand we have no reason to use storage classes because it may be used only once.

@vitaliy-leschenko that's a limitation on Windows, you could still use storage class to get dynamic provisioning, while you could only use one PVC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants