1

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 ?

Jason Stanley
  • 81
  • 1
  • 1
  • 3

1 Answers1

1

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.

Jason Stanley
  • 81
  • 1
  • 1
  • 3