但是,如果容器中的用户不是root用户,则该用户将无法访问该目录,因为它由root拥有.
访问这样一个卷的正确方法是什么? (在创建和安装该卷时,我没有找到任何用户/权限选项.)
解决方法 首先,找出您的进程正在运行的UID号.然后你可以通过添加.spec.securityContext.fsGroup
告诉Kubernetes chown(排序)你的pod的卷的挂载点:
spec: ... securityContext: fsGroup: 2000
总结
fsGroup
: integer: A special supplemental group that applIEs to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgID bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR’d with rw-rw—- If unset,the Kubelet will not modify the ownership and permissions of any volume.
以上是内存溢出为你收集整理的permissions – 允许对非root用户访问PersistentVolumeClaim全部内容,希望文章能够帮你解决permissions – 允许对非root用户访问PersistentVolumeClaim所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)