Hi guys, anyone who know why bash cannot work while trying to enter the containe . . .

Brian Gumisiriza:
Hi guys,
anyone who know why bash cannot work while trying to enter the container exec mode especially for all the pods in the kube-system namespace

kubectl exec -ti etcd-minikube -- /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown
command terminated with exit code 126

Raghunath Babalsure:
try kubectl exec -it etcd-minikube bash
OR
kubectl exec -it etcd-minikube sh

Brian Gumisiriza:
sh works but after entering most commands don’t work while using sh

Brian Gumisiriza:
@Raghunath Babalsure am getting this error still

brian@BG:~/Kubernetes$ kubectl exec -it etcd-minikube   bash

Brian Gumisiriza:

kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: "bash": executable file not found in $PATH: unknown
command terminated with exit code 126

Raghunath Babalsure:
i think bash shell is not available in your container.

Raghunath Babalsure:
with sh what command is not working?

unnivkn:

Brian Gumisiriza:
the ls command doesn’t work while using sh

~/Kubernetes$ kubectl exec -it etcd-minikube  -- bin/sh
sh-5.0# 
sh-5.0# ls
sh: ls: command not found
sh-5.0# cd
sh-5.0# cd /var/        
sh-5.0# ls
sh: ls: command not found

Brian Gumisiriza:
Even back space isn’t working. So its very annoying

unnivkn:
ectcd image won’t support most of the linux commands… read this. https://forum.linuxfoundation.org/discussion/857594/lab-4-1-sh-find-command-not-found

Brian Gumisiriza:
Thanks @unnivkn