Disha:
Hi all,
I am having an issue here connecting to my kube-apiserver
pod, could you please help/advise?
On running the following command, I get the error,
k exec kube-apiserver-xxxxxxxxxxxxxxxx -it -c kube-apiserver -- sh
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "xxxxxxxxxxx": OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "sh": executable file not found in $PATH: unknown
I tried to troubleshoot it by running the following commands (following responses on Google) but all of them gave the same error as above,
k exec kube-apiserver-xxxxxxxxxxxxxxxx -it -c kube-apiserver -- bin/sh
k exec kube-apiserver-xxxxxxxxxxxxxxxx -it -c kube-apiserver -- bash/sh
k exec kube-apiserver-xxxxxxxxxxxxxxxx -it -c kube-apiserver -- ./bin/sh
k exec kube-apiserver-xxxxxxxxxxxxxxxx -it -c kube-apiserver -- ./bash/sh
Then, I tried to find details of “sh” in ./bin
directory but that also failed
kubectl exec kube-apiserver-xxxxxxxxxxxxxxxx -c kube-apiserver -- ls -l /bin/sh
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "xxxxxxxxxx": OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "ls": executable file not found in $PATH: unknown
Lastly, I tried to check $PATH
value by but that also threw an error,
kubectl exec kube-apiserver-xxxxxxxxxxxxxxxx -c kube-apiserver -- echo $PATH
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "xxxxxxxxxxxxx": OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "echo": executable file not found in $PATH: unknown
The pod is healthy and the container logs also do not show anything weird.
Same happens when I try to connect to kube-controller-manager
pod as well
Could you please help?
Thanks a lot!