【发布时间】:2021-11-01 07:09:37
【问题描述】:
我正在Kubernetes 中了解卷。
我理解了音量的概念和音量的类型。
但是,我对 mouthPath 属性感到困惑。关注我的YAML 文件:
apiVersion: v1
kind: Pod
metadata:
name: nginx-alpine-volume
spec:
containers:
- name: nginx
image: nginx:alpine
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
readOnly: true
resources:
- name: html-updater
image: alpine
command: ["/bin/sh", "-c"]
args:
- while true; do date >> /mohit/index.html;sleep 10; done
resources:
volumeMounts:
- name: html
mountPath: /mohit
volumes:
- name: html
emptyDir: {}
问题:mountPath 属性有什么用。在这里,我使用一个带有两个容器的 pod。两个容器都有不同的mounPath 值。
更新:
【问题讨论】:
标签: docker kubernetes volume