This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.27.7. 指定子路径
使用 volumeMounts.subPath
属性在卷内指定 subPath
,而不是卷的根目录。subPath
允许您在一个 pod 中共享一个卷用于多个卷。
要查看卷中的文件列表,请运行 oc rsh
命令:
oc rsh <pod>
$ oc rsh <pod>
sh-4.2$ ls /path/to/volume/subpath/mount
example_file1 example_file2 example_file3
指定 subPath
:
subPath 用法示例