kubernetes pod 내에 홈 디렉터리를 마운트할 수 없습니다.

kubernetes pod 내에 홈 디렉터리를 마운트할 수 없습니다.

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 포드에 들어가면 홈 디렉터리가 마운트되지 않습니다. 포드에 디렉터리를 마운트하는 올바른 방법은 무엇입니까? 비밀을 생성하고 마운트해야 합니까? 내 포드 내부에 홈 디렉터리를 마운트하고 싶습니다.

관련 정보