Skip to main content

K8S Feature

MountPropagation

  • 挂载传播
  • None - private - 默认
  • HostToContainer - rslave
    • 主机挂在更新容器挂在
  • Bidirectional - rshared
    • 容器挂在传回主机
    • 特权容器
  • Alpha v1.9, Beta v1.10
deployment:
containers:
- image: alpine
name: alpine
volumeMounts:
- mount: /data
mountPropagation: None
# Host 对等操作
# --mark-slave
# --mark-private
# --make-unbindable
# --make-rshared
mount --make-shared /

# Docker 对等操作
docker run -d -it -v /tmp/mnt:/tmp/mnt:rshared ubuntu