Trying to mount Kubernetes volume to ceph rbd storage but getting FailedMount error

Viewed 32

Showing FailedMount error while mounting Kubernetes volume to ceph storage rbd

Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[data kube-api-access-mxlkm]: timed out waiting for the condition.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: ceph-claim-dynamic
spec:
  accessModes:  
    - ReadWriteOnce
  storageClassName: dynamic
  resources:
    requests:
      storage: 2Gi

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: dynamic
provisioner:  kubernetes.io/rbd
parameters:
  monitors: 192.168.122.82:6789,192.168.122.238:6789,192.168.122.124:6789 
  adminId: admin 
  adminSecretName: ceph-admin-secret 
  adminSecretNamespace: kube-system 
  pool: k8s 
  userId: kube  
  userSecretName: ceph-user-secret
  imageFormat: "2"


apiVersion: v1
kind: Pod
metadata:
  name: ceph-pod1
spec:
  containers:
  - name: ceph-busybox
    image: busybox
    command: ["sleep", "60000"]
    volumeMounts:
    - name: data
      mountPath: /data
      readOnly: false
  volumes:
  - name: data
    persistentVolumeClaim:
      claimName: ceph-claim-dynamic
Events:
  Type     Reason       Age                 From               Message
  ----     ------       ----                ----               -------
  Normal   Scheduled    38m                 default-scheduler  Successfully assigned default/ceph-pod1 to worker1
  Warning  FailedMount  14m                 kubelet            Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[kube-api-access-mxlkm data]: timed out waiting for the condition
  Warning  FailedMount  28s (x16 over 36m)  kubelet            Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[data kube-api-access-mxlkm]: timed out waiting for the condition

check below attach image

enter image description here

1 Answers

Don't know much about kube but you could deploy a simple kube pod and just mount a RBD there and rule out if you have a connectivity issue or a kube config issue.

Map rbd: rbd map foopool/rbd_volume --id admin --keyring /etc/ceph/ceph.client.admin.keyring

And see if it work. Good luck!

Related