如何在kubernetes上设置hostPath卷权限? [英] How can I set the hostPath volume permission on kubernetes?

查看:2499
本文介绍了如何在kubernetes上设置hostPath卷权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Kubernetes似乎在目录上创建具有755权限的hostPath卷.

It seems by default Kubernetes creates a hostPath volume with 755 permission on a directory.

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

Is it possible to set this value to something else by a volume spec? As opposed to manually doing a chmod on the relevent host directory.

推荐答案

  initContainers:
    - name: volume-mount-hack
      image: busybox
      command: ["sh", "-c", "chmod -R 777 /tmp/docker"]
      volumeMounts:
      - name: redis-socket
        mountPath: /tmp/docker

这篇关于如何在kubernetes上设置hostPath卷权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆