Kubernetes ポッド内でホーム ディレクトリをマウントできません

Kubernetes ポッド内でホーム ディレクトリをマウントできません

IP 10 にローカル マシン NVIDIA DGX1 があります。.* ユーザー ID を使用して ssh 経由でログインします。アカウントを入力したら、pod creation.sh ファイルを実行します (以下を参照)。

echo "Enter container image name"
read container

echo "Enter container name"
read name

echo "Enter the number of GPus required"
read gpu
cat <<EOF >$HOME/${name}-pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: $name
spec:
  volumes:
  - name: shared-data
    emptyDir: {}
  securityContext:
    runAsUser: $(id -u)
    fsGroup: $(id -g)
  containers:
  - name: $name
    image: $container
    resources:
      limits:
        nvidia.com/gpu: $gpu
    command: [ "/bin/bash", "-c", "--" ]
    args: [ "while true; do sleep 1; done;" ]
    volumeMounts:
    - name: ${name}-data
      mountPath: /workspace
  volumes:
  - name: ${name}-data
    hostPath:
      path: /raid/$(whoami)
      type: Directory
  hostNetwork: true
  dnsPolicy: Default
EOF

cd $HOME
kubectl create -f ${name}-pod.yaml 
rm $name-pod.yaml

Kubernetes ポッドに入った後、ホーム ディレクトリがマウントされません。ディレクトリをポッドにマウントする適切な方法は何でしょうか。シークレットを作成してマウントする必要がありますか。ホーム ディレクトリをポッド内にマウントしたいです。

関連情報