26.7. 指定子路径
使用 volumeMounts.subPath 属性在卷中指定 ,而不是卷的根目录。subPath 允许您在一个 pod 中为多个卷共享一个卷。
subPath
要查看卷中的文件列表,请运行 oc rsh 命令:
oc rsh <pod> sh-4.2$ ls /path/to/volume/subpath/mount example_file1 example_file2 example_file3
$ oc rsh <pod>
sh-4.2$ ls /path/to/volume/subpath/mount
example_file1 example_file2 example_file3
指定 subPath:
subPath 用法示例