根据https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/中的说明,我正在尝试使用Kubectl登录正在运行的容器,但我失败了:
kubectl exec -it mycontainer -- /bin/bash
无法使用TTY-输入的不是终端或正确的类型 文件rpc错误:代码= 2 desc = oci运行时错误:exec失败: container_linux.go:247:启动容器进程引起“执行: \“ D:/ Applications / Git / usr / bin / bash \”:统计信息 D:/ Applications / Git / usr / bin / bash:没有这样的文件或目录“
命令以退出代码126终止
看起来kubectl试图在我的机器上执行bash,这完全不是我想要实现的。
我可以执行不带空格的命令:
$ kubectl exec mycontainer 'ls'
lib
start.sh
但没有:
$ kubectl exec mycontainer 'ls .'
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"ls .\": executable file not found in $PATH"
command terminated with exit code 126
我做错了什么?
我在mingw git shell中都尝试过,就像使用普通Windows控制台一样。