Score:1

Unable to mount FS as a non root user

us flag

I have a nginx image that runs as non root (user is nginx UID 101 GID 101 )in kubernetes. This image also has gcsfuse installed in it.

As the image runs with nginx user, I would like this user to mount a GCS bucket. When I try this, it fails

nginx@clamav-mirror-frontend-f5f6f8f8-9hlgs:/$ id
uid=101(nginx) gid=101(nginx) groups=101(nginx)

nginx@clamav-mirror-frontend-f5f6f8f8-9hlgs:/$ gcsfuse test-clamav-mirror /data
2021/12/08 20:09:42.144896 Start gcsfuse/0.38.0 (Go version go1.17.3) for app "" using mount point: /data
2021/12/08 20:09:42.261297 Opening GCS connection...
2021/12/08 20:09:42.588103 Mounting file system "test-clamav-mirror"...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: running /bin/fusermount: exit status 1

I went through this documentation and tried the following but the same result

nginx@clamav-mirror-frontend-f5f6f8f8-9hlgs:/$ gcsfuse -o rw,_netdev,allow_other,uid=101,gid=101 test-clamav-mirror /data
2021/12/08 20:10:22.460757 Start gcsfuse/0.38.0 (Go version go1.17.3) for app "" using mount point: /data
2021/12/08 20:10:22.562672 Opening GCS connection...
2021/12/08 20:10:22.959742 Mounting file system "test-clamav-mirror"...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: running /bin/fusermount: exit status 1

Is this even possible or am I missing some config ?

Score:1
us flag

Figured it out.

The path that I want to mount my bucket on /data needed to be owned by ngnix user. It was previously owned by root. The moment I gave ownership to nginx it now successfully mounts.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.