kubernetes persistent volume accessmode

你说的曾经没有我的故事 提交于 2019-11-30 01:25:39

问题


It seems that Kubernetes supports 3 kinds of access mode for persistent volume: ReadWriteOnce, ReadOnlyMany, ReadWriteMany. I'm really curious about the scheduler strategy for a pod which uses the ReadWriteOnce mode volume. For example, I created an RC which have pod num=2, I guess the two pods will be scheduled into the same host because they use the volume that has ReadWriteOnce mode? I really want to know the source code of this part.


回答1:


If a pod mounts a volume with ReadWriteOnce access mode, no other pod can mount it. In GCE (Google Compute Engine) the only allowed modes are ReadWriteOnce and ReadOnlyMany. So either one pod mounts the volume ReadWrite, or one or more pods mount the volume ReadOnlyMany.

The scheduler (code here) will not allow a pod to schedule if it uses a GCE volume that has already been mounted read-write.

(Documentation reference for those who didn't understand the question: persistent volume access modes)



来源:https://stackoverflow.com/questions/37649541/kubernetes-persistent-volume-accessmode

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