k8s mount propagation简介
2023-10-08 本文已影响0人
wwq2020
volume的MountPropagation有如下三种
None
HostToContainer
Bidirectional
linux的mount propagation mountflags有如下四种mountflags
MS_SHARED
MS_PRIVATE
MS_SLAVE
MS_UNBINDABLE
对应的mount命令分别为
mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint
如果是递归的话,则分别为
mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
mount --make-runbindable mountpoint
简单总结
None通过MS_PRIVATE实现
HostToContainer通过MS_PRIVATE实现
Bidirectional通过MS_SHARED实现