Environment:
Kubernetes cluster with 1 master and 3 nodes Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-66-generic x86_64) (VMWARE VMs)
Pod (simple nginx image) cannot be mounted to a specified Volume in Kubernetes cluster with rook-ceph and csi-cephfs storage class. It shows an error:
MountVolume.MountDevice failed for volume "pvc-9aad698e-ef82-495b-a1c5-e09d07d0e072" : rpc error: code = Aborted desc = an operation with the given Volume ID 0001-0009-rook-ceph-0000000000000001-89d24230-0571-11ea-a584-ce38896d0bb2 already exists
PVC and PV are green. PVC is ReadWriteMany
but it also fails with ReadWriteOnce
Ceph cluster is HEALTH_OK
and all is green.
What am i missing?
Some more logs:
Normal Scheduled <unknown> default-scheduler Successfully assigned rook-ceph/csicephfs-demo-pod to <myhost>
Normal SuccessfulAttachVolume 2m37s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-c1ad8144-15ae-49f6-a012-d866b74ff902"
Warning FailedMount 2m17s kubelet, <myhost> Unable to attach or mount volumes: unmounted volumes=[mypvc], unattached volumes=[mypvc default-token-wfjxl]: timed out waiting for the condition
Warning FailedMount 2m4s kubelet, <myhost> MountVolume.MountDevice failed for volume "pvc-c1ad8144-15ae-49f6-a012-d866b74ff902" : rpc error: code = DeadlineExceeded desc = context deadline exceeded
Warning FailedMount 108s (x5 over 2m4s) kubelet, <myhost> MountVolume.MountDevice failed for volume "pvc-c1ad8144-15ae-49f6-a012-d866b74ff902" : rpc error: code = Aborted desc = an operation with the given Volume ID 0001-0009-rook-ceph-0000000000000001-0bc5ddfc-05f2-11ea-9f0a-bee51ab2829b already exists
kubectl -n rook-ceph get pv,pvc -o wide
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE VOLUMEMODE
persistentvolume/pvc-c1ad8144-15ae-49f6-a012-d866b74ff902 1Gi RWX Delete Bound rook-ceph/cephfs-pvc-many2 csi-cephfs 114m Filesystem
persistentvolume/pvc-d678dd06-7197-4342-934d-33e60edc564a 1Gi RWO Delete Bound rook-ceph/cephfs-pvc csi-cephfs 6d19h Filesystem
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE VOLUMEMODE
persistentvolumeclaim/cephfs-pvc Bound pvc-d678dd06-7197-4342-934d-33e60edc564a 1Gi RWO csi-cephfs 11d Filesystem
persistentvolumeclaim/cephfs-pvc-many2 Bound pvc-c1ad8144-15ae-49f6-a012-d866b74ff902 1Gi RWX csi-cephfs 118m Filesystem
Original PVC YAML:
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cephfs-pvc-many2
namespace: rook-ceph
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 1Gi
storageClassName: csi-cephfs
POD:
---
apiVersion: v1
kind: Pod
metadata:
name: csicephfs-demo-pod
namespace: rook-ceph
spec:
containers:
- name: web-server
image: nginx
volumeMounts:
- name: mypvc
mountPath: /var/lib/www/html
volumes:
- name: mypvc
persistentVolumeClaim:
claimName: cephfs-pvc-many2
readOnly: false