mountpoint-s3-csi-driver: Mount error with --allow-overwrite flag and several pods launched

Mountpoint for Amazon S3 version

mount-s3 version:1.8.0

AWS Region

us-west-2

Describe the running environment

Running in EKS 1.30 spot nodes with Mountpoint for Amazon S3 CSI driver 1.8.0. AWS credentials are provided via k8s secret with name aws-secret (access_key and key_id) Operation system: amazon-eks-gpu-node-1.30-v20240615

Mountpoint options

Mount options in helm chart:

spec:
  storageClassName: s3-sc
  capacity:
    storage: {{ .pvc_size }}
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  mountOptions:
    - allow-delete
    - allow-other
    - allow-overwrite
    - uid=1000
    - gid=1000
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: s3.csi.aws.com

What happened?

Without an --allow-overwrite flag, both S3 buckets mounted correctly without any errors. However, users cannot edit files; they can only write and delete them. With --allow-overwrite behavior is unstable:

  1. sometimes mounted directory has d???????? instead of drwxr-xr-x
  2. more frequently properties are fine, but the wrong bucket is mounted.

For example, I have two buckets: creators-drives and notebooks-storage. I mount it with the mount options:

    {
        "name": "creators-drives",
        "subPath": "users/user1/drive",
        "path": "drive",
        "pvc_size": "500Gi"
    },
    {
        "name": "notebooks-storage",
        "subPath": "users/user1",
        "path": "notebookdrive/users/user1",
        "pvc_size": "500Gi"
    }

In the first k8s pod in /drive folder I can see the correct files from the creators-drives bucket, but in the second pod in/drive folder I see files from notebooks-storage bucket from users/user1/drive/ folder.

Relevant log output

No errors in the logs from s3-CSI-node pods.

I0906 10:09:07.818025       1 node.go:65] NodePublishVolume: req: volume_id:"playing-albatross-creators-drives" target_path:"/var/lib/kubelet/pods/4d49a5d8-5b60-47d4-aa87-34ebdfcb6bd0/volumes/kubernetes.io~csi/playing-albatross-creators-drives/mount" volume_capability:<mount:<mount_flags:"allow-delete" mount_flags:"allow-other" mount_flags:"allow-overwrite" mount_flags:"uid=1000" mount_flags:"gid=1000" > access_mode:<mode:MULTI_NODE_MULTI_WRITER > > volume_context:<key:"bucketName" value:"creators-drives" > 
I0906 10:09:07.818242       1 node.go:112] NodePublishVolume: mounting creators-drives at /var/lib/kubelet/pods/4d49a5d8-5b60-47d4-aa87-34ebdfcb6bd0/volumes/kubernetes.io~csi/playing-albatross-creators-drives/mount with options [--allow-delete --allow-other --allow-overwrite --gid=1000 --uid=1000]
I0906 10:09:07.871977       1 node.go:133] NodePublishVolume: /var/lib/kubelet/pods/4d49a5d8-5b60-47d4-aa87-34ebdfcb6bd0/volumes/kubernetes.io~csi/playing-albatross-creators-drives/mount was mounted

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (12 by maintainers)

Most upvoted comments

Thank you for your help @unexge ! The problem was in the absence of specifying the volume name in the PVC and the volume was chosen arbitrarily. The correct PVC option now looks like this:

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ $.Values.apps.myapp.app_name }}-{{ .name }}
  namespace: {{ $.Release.Namespace }}
spec:
  storageClassName: s3-sc
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: {{ .pvc_size }}
  volumeName: {{ $.Values.apps.myapp.app_name }}-{{ .name }}
{{- end }}