gpt4 book ai didi

docker - Kubernetes(1.10)mountPropagation:双向不起作用。

转载 作者:行者123 更新时间:2023-12-02 11:44:48 26 4
gpt4 key购买 nike

我正在创建一个将volumeMount设置为mountPropagation: Bidirectional的容器。创建后,容器将使用"Propagation": "rprivate"挂载该卷。

从k8s docs中,我希望mountPropagation: Bidirectional会导致rshared的卷安装传播

如果我直接使用docker启动容器,则此方法有效。

一些信息:

部署Yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: test
spec:
selector:
matchLabels:
app: test
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: test
spec:
containers:
- image: gcr.io/google_containers/busybox:1.24
command:
- sleep
- "36000"
name: test
volumeMounts:
- mountPath: /tmp/test
mountPropagation: Bidirectional
name: test-vol
volumes:
- name: test-vol
hostPath:
path: /tmp/test

docker inspect的结果安装部分
"Mounts": [
{
"Type": "bind",
"Source": "/tmp/test",
"Destination": "/tmp/test",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}…..

等效的Docker运行
docker run --restart=always --name test -d --net=host --privileged=true -v /tmp/test:/tmp/test:shared gcr.io/google_containers/busybox:1.24

使用docker inspect创建时docker run中的“结果挂载”部分
"Mounts": [
{
"Type": "bind",
"Source": "/tmp/test",
"Destination": "/tmp/test",
"Mode": "shared",
"RW": true,
"Propagation": "shared"
}...

kubectl版本的输出
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-13T22:29:03Z", GoVersion:"go1.9.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

使用 rke version v0.1.6

最佳答案

这是https://github.com/kubernetes/kubernetes/pull/62633中1.10.3中修复的回归

关于docker - Kubernetes(1.10)mountPropagation:双向不起作用。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50526275/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com