cloudnativelabs / kube-shell

Kubernetes shell: An integrated shell for working with the Kubernetes
Apache License 2.0
2.38k stars 175 forks source link

"kubectl" command not found error.. #18

Open humblec opened 7 years ago

humblec commented 7 years ago
[root@localhost ~]# kube-shell

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

Any thoughts why this happens?

murali-reddy commented 7 years ago

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

humblec commented 7 years ago

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"}
vogxn commented 7 years ago

@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

striveman1379 commented 5 years ago

[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?

devopsvenkat1488 commented 5 years ago

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

andradedpg commented 2 years ago

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

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