kubernetes-csi/csi-driver-smb

Mounting wrong PVC on the POD

aupadh12 opened this issue · 3 comments

What happened:

Hi Team,

We have a platform where we deploy our applications. We also have an external windows based filesystem which we mount on our containers. We have a share on this filesystem where we mount the files related to landing page consisting of index.html and some images.
We also have an application deployed on this platform which runs inside its own container and has a share on the same filesystem mounted as a volume. this share has application specific files.

What you expected to happen:
the platform has a container and its own pv and pvc has data files which are pointing to its own share in the windows filesystem while the application container has pv,pvc pointing to the data on the windows filesystem and has its own data.

How to reproduce it:
But we have seen that the application container shows data from pv,pvc which should only be with the platform container.
Anything else we need to know?:

Environment:

v1.12.0
  • CSI Driver version: v1.12.0
  • Kubernetes version (use kubectl version): 1.26
  • OS (e.g. from /etc/os-release): Linux

what's the two PVs config? are you using the same volumeHandle value with these two PVs?

Hi @andyzhangx , yes ,the volumeHandle is the same and is an IP of the external filesystem.
However, I have used volumeAttributes as mentioned below:

PV1:

apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: smb.csi.k8s.io name: shinyproxy-templates-dev spec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain claimRef: namespace: dev name: shinyproxy-templates-dev storageClassName: smb mountOptions: - dir_mode=0777 - file_mode=0777 - vers=2.1 - sec=ntlmsspi - uid=1001 - gid=1001 - nodfs csi: driver: smb.csi.k8s.io readOnly: false volumeHandle: 10.56.12.08 volumeAttributes: source: "//10.56.12.08/share/templates_20231005/dev" nodeStageSecretRef: name: cifs-secret namespace: dev

PV2:

apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: smb.csi.k8s.io name: pv2 spec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain claimRef: namespace: dev name: pv2 storageClassName: smb mountOptions: - dir_mode=0777 - file_mode=0777 - vers=2.1 - sec=ntlmsspi - uid=1001 - gid=1001 - nodfs csi: driver: smb.csi.k8s.io readOnly: false volumeHandle: 10.56.12.08 volumeAttributes: source: "//10.56.12.08/share/pv2" nodeStageSecretRef: name: cifs-secret namespace: dev

Hi,

I was able to solve this issue by having different volume handles. I initially thought I have to use the same IP address of the filesystem.
This issue can be closed.