没有写到emptyDir的权限 [英] Do not have permission to write to emptyDir

查看:160
本文介绍了没有写到emptyDir的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将带有存储介质的emptyDir卷安装到Pod.然后,我登录到Pod,并尝试在该卷路径中创建文件,但出现了权限被拒绝的错误.

I have mounted a emptyDir volume with memory medium to a pod. Then I logged into the pod and tried to create a file in that volume path but I got a permission denied error.

touch a.txt
touch: cannot touch `a.txt': Permission denied

我使用的用户是root.可能是什么原因?

User I used is root. What could be the reason for that?

推荐答案

添加:z或:Z作为您的安装路径的解决方法,以使其与selinux正常工作:

Add :z or :Z as a workaround to your mount path to work properly with selinux:

volumeMounts:
- name: etcd-storage
  mountPath: /var/etcd/data:z

这篇关于没有写到emptyDir的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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