openshift persistent volumes

ⅰ亾dé卋堺 提交于 2019-12-12 02:53:19

问题


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?

thanks in advance!


回答1:


NFS persistent volumes will be the same across multiple pods. You can always use the pod name as an environment variable and have each pod set up a unique sub directory. But it is not possible to mount the same NFS volume and have the root directory not be identical.




回答2:


@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



来源:https://stackoverflow.com/questions/36624034/openshift-persistent-volumes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!