26.7. サブパスの指定
volumeMounts.subPath プロパティーを使用して、ボリュームのルートではなく、ボリューム内の サブパス を指定します。subPath を使用すると、1 つの Pod でボリュームを共有して複数の用途に使用できます。
ボリューム内のファイルの一覧を表示するには、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 の使用例