问题描述
我们可以在openshift v3.1中为多个Pod使用相同的NFS持久卷吗?因为我注意到的是,当我将相同的持久卷安装到多个Pod时,容器的已安装目录中的所有数据都被服务器的NFS卷目录替换了.如何确保NFS卷具有来自多个Pod的数据.吊舱仅具有其数据,而不是来自PV的所有数据?
can we use same NFS persistent volume for multiple pods in openshift v3.1. because what I noticed is when I mount the same persistent volumes to multiple pods, all data inside mounted directory of container gets replaced by NFS volume directory of server. How to make sure that NFS volume has data from multiple pods. And pods only has their data, not all data from the PV?
提前谢谢!
推荐答案
@priyank-我认为,如果您想限制共享存储中的数据/目录,则可以从securityContext中传入SupplementalGroup,然后设置所有权和NFS服务器上的组,即dir1向组A和B开放,然后dir1/dirA仅对podA开放,而dir1/dirB仅开放podB-因此,所有Pod都可以访问dir1,但是只有podA可以访问dirA,而podB可以访问目录但是,克莱顿(Clayton)上面所说的对于共享的根目录是正确的
@priyank - I think if you want to restrict data/directories on your shared storage, you could pass in supplementalGroups from the securityContext and then set up the ownership and groups on the NFS server i.e. dir1 open to groups A and B and then dir1/dirA only open to podA and dir1/dirB only open podB - so all pods have access to dir1 but then only podA has access to dirA and podB has access to dirB. But what clayton said above is true regarding the root directory of the share
这篇关于openshift持久卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!