写pod的yaml文件时,如果想使用云存储,则volumeMounts这个property,
mountPath 为container内部目录
而subPath 虽然紧跟mountpath, 最容易被误解为本地路径,其实其为远端云存储上的子路径

所以进入pod内部看磁盘情况,显示
bbuser@stream-notifications-baseline-learn-tomcat-7cd697-2xwp7:~$ df -v
Filesystem 1K-blocks Used Available Use% Mounted on
10.114.70.2:/learn_perf_bbcontent_1/instance/stream-notifications-baseline
570422592 19338048 551084544 4% /mnt/bbcontent
- name: learn image: ${LEARN_DOCKER_IMAGE} imagePullPolicy: IfNotPresent
resources: requests: cpu: ${LEARN_CPU_REQUEST} memory: ${LEARN_MEM_REQUEST}
limits: cpu: ${LEARN_CPU_LIMITS} memory: ${LEARN_MEM_LIMITS} command: -
${BB_USER_HOME}/bin/launcher.sh env: - name: DEV_FEATURES valueFrom:
configMapKeyRef: name: ${INSTANCE_NAME}-learn-config key: DEV_FEATURES
volumeMounts: - name: bbcontent **mountPath: /mnt/bbcontent subPath:
instance/${INSTANCE_NAME} ** volumes: - name: bbcontent persistentVolumeClaim:
claimName: learn-deployments-share
volume 和name(container的名字)是统一层级。

技术
下载桌面版
GitHub
Gitee
SourceForge
百度网盘(提取码:draw)
云服务器优惠
华为云优惠券
腾讯云优惠券
阿里云优惠券
Vultr优惠券
站点信息
问题反馈
邮箱:[email protected]
吐槽一下
QQ群:766591547
关注微信