wetopi / docker-volume-rbd

Docker Engine managed plugin to manage RBD volumes.
MIT License
69 stars 18 forks source link

Ubuntu 20.04.2 and Docker version 20.10.2 needs cpability CAP_NET_ADMIN #20

Closed jhernandez-cefca closed 3 years ago

jhernandez-cefca commented 3 years ago

The driver fail to create volumes in Ubuntu 20.04.2 with Docker version 20.10.2. Adding the capability CAP_NET_ADMIN for the driver, then it works. It maybe may occur in other Linux distributions with newer kernels.

JvGinkel commented 3 years ago

May I ask how you add this capability? I think I'm running into the same issue as you did with this error:

VolumeDriver.Create: volume-rbd Name=unable to open the ceph cluster connection: rados: ret=13, Permission denied Request=Create Message=unable to connect to rbd pool

Thanks

JvGinkel commented 3 years ago

I figured out how and after building the plugin with the CAP_NET_ADMIN added it's all working again.

jhernandez-cefca commented 3 years ago

Sorry, I am late in the response but maybe is useful for others:

Get the Driver code and create a Docker image

wget https://github.com/wetopi/docker-volume-rbd/archive/refs/tags/3.0.0.zip unzip 3.0.0.zip cd docker-volume-rbd-3.0.0/ docker build --tag wetopi-CUSTOM:3.0.0 .

Create a container to export the root file system to folder 'rootfs'

docker create wetopi-CUSTOM:3.0.0  # returns the container ID: d7cc170f6f8fe15b9fa83904d16df94a881698f8f81ed3a429c82a2df3b97db0 (will be different) cd .. mkdir wetopi-CUSTOM cd mkdir wetopi-CUSTOM mkdir rootfs cd rootfs/ docker export d7cc170f6f8fe15b9fa83904d16df94a881698f8f81ed3a429c82a2df3b97db0 | tar -xvf -

Copy and modify 'config.json'

cd .. cp ../docker-volume-rbd-3.0.0/config.json . nano config.json  # Add CAP_NET_ADMIN to capabilities

Create the plugin in Docker from the directory

docker plugin create wetopi-CUSTOM:3.0.0 .

Initialize and enable (adjust for your system)

docker plugin set RBD_CONF_POOL=rbd RBD_CONF_CLUSTER=ceph RBD_CONF_KEYRING_USER=client.user docker plugin enable wetopi-CUSTOM:3.0.0 docker plugin ls

El 24/8/21 a las 11:28, Jethro escribió:

May I ask how you add this capability? I think I'm running into the same issue as you did with this error:

|VolumeDriver.Create: volume-rbd Name=unable to open the ceph cluster connection: rados: ret=13, Permission denied Request=Create Message=unable to connect to rbd pool|

Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wetopi/docker-volume-rbd/issues/20#issuecomment-904479673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUKNRUAOVFFC73DYJPWHLGTT6NQ43ANCNFSM46ASZ34A. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

sitamet commented 3 years ago

@jhernandez-cefca there is no need to compile a new driver to modify config.

JvGinkel commented 3 years ago

Maybe you can tell us how to fix this issue then?

sitamet commented 3 years ago

We are pushing a new release 3.0.1 CAP_NET_ADMIN

JvGinkel commented 3 years ago

I noticed c89b9e6 can you also create a release? Thanks

sitamet commented 3 years ago

@JvGinkel release tagged sorry