Description
重现问题所需的命令:
kubectl apply -f test.yaml
失败的命令的完整输出:
Events:
Type Reason Age From Message
Normal Scheduled 64s default-scheduler Successfully assigned default/test-0 to minikube
Warning BackOff 25s (x2 over 55s) kubelet Back-off restarting failed container cis in pod test-0_default(238fc24f-176b-4143-9b15-672ad06c27b4)
Normal Pulled 11s (x4 over 63s) kubelet Container image "test.dkr.ecr.us-east-1.amazonaws.com/test:2024.05" already present on machine
Normal Created 11s (x4 over 62s) kubelet Created container: test
Warning Failed 11s (x4 over 62s) kubelet Error: failed to start container "cis": Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/kubelet/pods/238fc24f-176b-4143-9b15-672ad06c27b4/volume-subpaths/pvc-135d5675-1e29-4db2-9b89-814acc27c63a/cis/18" to rootfs at "/opt/test/test2022/rootInfo": mount src=/var/lib/kubelet/pods/238fc24f-176b-4143-9b15-672ad06c27b4/volume-subpaths/pvc-135d5675-1e29-4db2-9b89-814acc27c63a/cis/18, dst=/opt/test/test2022/rootInfo, dstFd=/proc/self/fd/8, flags=0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
minikube logs
命令的输出:
Error: failed to start container "cis": Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/kubelet/pods/238fc24f-176b-4143-9b15-672ad06c27b4/volume-subpaths/pvc-135d5675-1e29-4db2-9b89-814acc27c63a/cis/18" to rootfs at "/opt/test/test2022/rootInfo": mount src=/var/lib/kubelet/pods/238fc24f-176b-4143-9b15-672ad06c27b4/volume-subpaths/pvc-135d5675-1e29-4db2-9b89-814acc27c63a/cis/18, dst=/opt/test/test2022/rootInfo, dstFd=/proc/self/fd/8, flags=0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
使用的操作系统版本:
CentOS Linux 7