Rook: Deployment 3 replicas - Volume is already attached by pod (second and third replicas)

Created on 19 Jul 2018  路  4Comments  路  Source: rook/rook

Trying to create a deployment (with 3 replicas) with PVC. The first pod attached to PVC sucessfully.

The second and third pod shows the same error:

MountVolume.SetUp failed for volume "pvc-ed04a6ce-8b7f-11e8-ab36-08002759a5f7" : mount command failed, status: Failure, reason: Rook: Mount volume failed: failed to attach volume pvc-ed04a6ce-8b7f-11e8-ab36-08002759a5f7 for pod default/nginx-deployment-86dfb99868-n82x8. Volume is already attached by pod default/nginx-deployment-86dfb99868-szpkd. Status Running

Using Kubernetes 1.11 and Centos 7.

flexvolume wontfix

Most helpful comment

I am observing this behavior with RWX access mode claims. Rook 0.8.

All 4 comments

Hi @gustavomr, the volumes provisioned and mounted by rook-ceph-block are ReadWriteOnce meaning they can not have more than one writer attach to the same volume. See https://github.com/rook/rook/blob/release-0.8/cluster/examples/kubernetes/mysql.yaml#L24.

Were you intending for them all to access/share the same volume? If so, you could look at using a shared filesystem instead: https://rook.io/docs/rook/v0.8/filesystem.html

If you want the 3 replicas to each get their own volume, you could consider using a StatefulSet instead that has a volumeClaimTemplate. Specifying the rook-ceph-block storage class in that template would get 3 separate volumes created for you. More details: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.

I am observing this behavior with RWX access mode claims. Rook 0.8.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

funkypenguin picture funkypenguin  路  4Comments

DanKerns picture DanKerns  路  4Comments

zerkms picture zerkms  路  4Comments

mabushey picture mabushey  路  5Comments

ryholt picture ryholt  路  4Comments