kube-shell icon indicating copy to clipboard operation
kube-shell copied to clipboard

"kubectl" command not found error..

Open humblec opened this issue 8 years ago • 6 comments
trafficstars

[root@localhost ~]# kube-shell

kube-shell> kubectl get services
/bin/sh: kubectl: command not found
kube-shell> exit

Any thoughts why this happens?

humblec avatar Jul 02 '17 14:07 humblec

Do you have kubectl avaialable on the host and placed in executable path? Kube-shell does not install kubectl.

murali-reddy avatar Jul 02 '17 14:07 murali-reddy

I have it,

[root@localhost~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.1.34+a41e1c52ef5341-dirty", GitCommit:"a41e1c52ef5341a0bd9a9c7f622dba5764640ec6", GitTreeState:"dirty", BuildDate:"2017-06-23T15:35:06Z", GoVersion:"go1.8.1", Compiler:"gc", Platform:"linux/amd64"}

humblec avatar Jul 02 '17 14:07 humblec

@humblec could you provide the output to the following

$ which kubectl
$ /bin/sh
sh-3.2$ echo $PATH

Our subprocess(..) call to kubectl will default to /bin/sh as the shell environment. Perhaps your paths need some adjustment

vogxn avatar Jul 02 '17 16:07 vogxn

[root@k8s /]# which kubectl /usr/bin/which: no kubectl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) [root@k8s /]# find / -name kubectl [root@k8s /]# kubectl get pod -bash: kubectl: command not found [root@k8s /]#


why this happens?

striveman1379 avatar May 25 '19 09:05 striveman1379

Hi, Any answers for this, becoz I am facing the same issue, though I have installed the kops and kubectl in linux machine. Please share your thoughts

bash: kubectl: command not found

VenkateshSarivisetty avatar Aug 07 '19 17:08 VenkateshSarivisetty

I really don't know thats is necessary... But I solved that with symlink

ln -s /usr/local/bin/kubectl /usr/bin/

andradedpg avatar Mar 24 '22 14:03 andradedpg