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
の結果のMountsセクション
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
を使用する
回答 1 件
関連した質問
- 同じマウントパスを持つ複数の永続ボリュームKubernetes
- Traefikでパスを書き換える
- lagom設定のオーバーライド
- DockerでのKubernetesの構築
- Docker化されていないアプリケーションをkubenetes posに接続します
- Docker-for-macまたはDocker-for-Windowsから閲覧可能なURLを取得する方法は?
- hostPathマウントのボリュームコンテンツが表示されない
- Kubeletの実行に失敗しました:証明書署名要求を作成できません:許可されていません
- jenkinsを使用してkubernetesインスタンスでdocker-composeを使用します。空のボリュームのマウント
これはhttps://github.com/kubernetes/kubernetes/pull/62633の1.10.3で修正されたリグレッションでした