如何在 kubernetes 上设置 hostPath 卷权限?

Chr*_*ski 5 kubernetes

默认情况下,Kubernetes 似乎会创建一个755具有目录权限的 hostPath 卷。

是否可以通过volume规范将此值设置为其他值?与chmod在相关主机目录上手动执行相反。

Chr*_*ski 7

  initContainers:
    - name: volume-mount-hack
      image: busybox
      command: ["sh", "-c", "chmod -R 777 /tmp/docker"]
      volumeMounts:
      - name: redis-socket
        mountPath: /tmp/docker
Run Code Online (Sandbox Code Playgroud)