Skip to content
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

Multiple pods ReadWriteMany mount with static provisioning #200

Closed
Shaked opened this issue May 19, 2021 · 1 comment · Fixed by #201
Closed

Multiple pods ReadWriteMany mount with static provisioning #200

Shaked opened this issue May 19, 2021 · 1 comment · Fixed by #201

Comments

@Shaked
Copy link

Shaked commented May 19, 2021

What happened:

Hey, I'm trying to use https://github.com/kubernetes-csi/csi-driver-nfs with a static provisioning while I want to have multiple pods to mount a ReadWriteMany NFS server. Unfortunately the pods always get stuck in ContainerCreating with the following error:

Warning FailedMount 3m40s (x1662 over 48m) kubelet MountVolume.SetUp failed for volume "clearml-agent-caching" : rpc error: code = Aborted desc = An operation with the given Volume ID shaked-test1 already exists

What you expected to happen:

Allow all pods to mount the NFS server while all pods have access to the same files i.e /exports content should be available for all pods (therefore I don't want to use dynamic provisioning).

How to reproduce it:

Create a PV and PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: clearml-agent-claim
  namespace: clearml
spec:
  selector:
    matchLabels:
      {{- include "clearml-agent.labels" . | nindent 6 }}
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  volumeName:  clearml-agent
  resources:
    requests:
      storage: 100Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: clearml-agent
  labels:
    {{- include "clearml-agent.labels" . | nindent 6 }}
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteMany
  mountOptions:
    - hard
    - cvers=4.1
  csi:
    driver: nfs.csi.k8s.io
    readOnly: false
    volumeHandle: "shaked-test1" # {{ uuidv4 }}  # make sure it's a unique id in the cluster
    volumeAttributes:
      server: clearml-agent.clearml.svc.cluster.local
      share: /

Create 2 replicas or more:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs-test-deployment
  labels:
    app: nfs-test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nfs-test
  template:
    metadata:
      labels:
        app: nfs-test
    spec:
      containers:
      - name: nfs-shaked-test
        image: d3fk/nfs-client
        command: [ "sleep" ]
        args: [ "infinity" ]
        securityContext:
          privileged: true
        resources: {}
        env:
          - name: SHARE
            value: "/shakedsnfs"
          - name: SERVER
            value: "clearml-agent-caching.clearml.svc.cluster.local"
        volumeMounts:
          - mountPath: /shakedsnfs
            name: caching-nfs
            readOnly: false
      volumes:
        - name: caching-nfs
          persistentVolumeClaim:
            claimName: clearml-agent-caching-claim

Create an NFS server as in the example.

Anything else we need to know?:

Environment: GKE

  • CSI Driver version: Lateset
  • Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4", GitCommit:"d360454c9bcd1634cf4cc52d1867af5491dc9c5f", GitTreeState:"clean", BuildDate:"2020-11-12T01:09:16Z", GoVersion:"go1.15.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.17-gke.1900", GitCommit:"c97b098770a3dcd2e36fdccd8ec5642a5cddbd7f", GitTreeState:"clean", BuildDate:"2021-04-14T09:22:16Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}

@andyzhangx
Copy link
Member

andyzhangx commented May 19, 2021

already fixed on master branch, pls try again, make sure that latest image is downloaded on your node(set imagePullPolicy: true)

humblec added a commit to humblec/csi-driver-nfs that referenced this issue Sep 23, 2022
d24254f Merge pull request kubernetes-csi#202 from xing-yang/kind_0.14.0
0faa3fc Update to Kind v0.14.0 images
ef4e1b2 Merge pull request kubernetes-csi#201 from xing-yang/add_1.24_image
4ddce25 Add 1.24 Kind image
7fe5149 Merge pull request kubernetes-csi#200 from pohly/bump-kubernetes-version
70915a8 prow.sh: update snapshotter version
31a3f38 Merge pull request kubernetes-csi#199 from pohly/bump-kubernetes-version
7577454 prow.sh: bump Kubernetes to v1.22.0

git-subtree-dir: release-tools
git-subtree-split: d24254f
TerryHowe pushed a commit to TerryHowe/csi-driver-nfs that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants