在GKE中使用gcsfuse挂载存储桶

时间:2017-11-24 13:36:33

标签: google-cloud-platform google-cloud-storage gcsfuse

我试图在Google云端的GKE内部的容器中安装一个存储桶,但我有以下错误......有什么想法吗?

gcsfuse -o nonempty --foreground --debug_fuse --debug_fuse --debug_http --debug_invariants --key-file=credentials.json bucket-example /tmp/test

日志:

http: ========== RESPONSE:
HTTP/2.0 200 OK
Content-Length: 31
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Server: UploadServer
Vary: Origin
Vary: X-Origin

{
 "kind": "storage#objects"
}
http: ====================
Mounting file system...
mountWithArgs: mountWithConn: Mount: mount: running fusermount: exit status 1

stderr:
fusermount: fuse device not found, try 'modprobe fuse' first

modprobe保险丝

modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.64+/modules.dep.bin'
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.64+

uname -r

4.4.64+

THX !!

1 个答案:

答案 0 :(得分:1)

将securityContext添加到容器的yaml:

    image: example:latest
    name: example-name
    securityContext:
      privileged: true
      capabilities:
        add:
          - SYS_ADMIN