Kind: zsh: command not found: kubectl

Created on 20 Feb 2020  ยท  9Comments  ยท  Source: kubernetes-sigs/kind

What happened:
kubectl throws command not found error post cluster creation using kind create cluster

What you expected to happen:
Should be able to run kubectl

How to reproduce it (as minimally and precisely as possible):
Download and add kind to path as mentioned below

curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64"
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

Anything else we need to know?:
This is how I created the cluster

โžœ  ~ kind create cluster --name hello-world --config=.kube/config
Creating cluster "hello-world" ...
 โœ“ Ensuring node image (kindest/node:v1.16.4) ๐Ÿ–ผ 
 โœ“ Ensuring node image (kindest/node:v1.17.0) ๐Ÿ–ผ
 โœ“ Preparing nodes ๐Ÿ“ฆ ๐Ÿ“ฆ  
 โœ“ Writing configuration ๐Ÿ“œ 
 โœ“ Starting control-plane ๐Ÿ•น๏ธ 
 โœ“ Installing CNI ๐Ÿ”Œ 
 โœ“ Installing StorageClass ๐Ÿ’พ 
 โœ“ Joining worker nodes ๐Ÿšœ 
Set kubectl context to "kind-hello-world"
You can now use your cluster with:

kubectl cluster-info --context kind-hello-world

Thanks for using kind! ๐Ÿ˜Š
โžœ  ~ kubectl
zsh: command not found: kubectl

config file:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  image: kindest/node:v1.16.4@sha256:b91a2c2317a000f3a783489dfb755064177dbc3a0b2f4147d50f04825d016f55

Environment:

good first issue help wanted kindocumentation

Most helpful comment

imho it's bad that our documentation assumes kubectl is available though, we should update it with a reference to this.

All 9 comments

ah, you're going to need to install kubectl.

https://kubernetes.io/docs/tasks/tools/install-kubectl/

Thanks a lot @BenTheElder for pointing that out. That was silly of me. I thought, like minikube, this will also make kubectl available.

imho it's bad that our documentation assumes kubectl is available though, we should update it with a reference to this.

@bentheelder Created an PR for this.

โžœ  ~ kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?
โžœ  ~ kind             
/usr/local/bin/kind: 1: /usr/local/bin/kind: Not: not found

I installed kubectl and kind using the below instructions in documentation, I still get this error.

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind
โžœ  ~ kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?
โžœ  ~ kind             
/usr/local/bin/kind: 1: /usr/local/bin/kind: Not: not found

I installed kubectl and kind using the below instructions in documentation, I still get this error.

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

Make sure that $(uname) actually evaluates to the operating system name.

I am using Windows with WSL 2. For me uname was resolving to "Linux" so the contents of the file kind was "Not Found"

โฏ uname
Linux
โฏ cat kind
Not Found%

So I used the following command to download kind:

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.9.0/kind-linux-amd64

we may need to upgrade the guide.
when it was written, github served files case-insensitively

On Wed, Oct 7, 2020 at 12:38 PM Zachary Radtka notifications@github.com
wrote:

I am using Windows with WSL 2. For me uname was resolving to "Linux" so
the contents of the file kind was "Not Found"

โฏ uname

Linux

โฏ cat kind

Not Found%

So I used the following command to download kind:

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.9.0/kind-linux-amd64

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes-sigs/kind/issues/1343#issuecomment-705151182,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHADK2B7ZZ32WQKUUW4353SJS7RTANCNFSM4KYHOXTQ
.

Not sure if all the releases are lowercase, but a simple fix would be:

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname | tr '[:upper:]' '[:lower:]')-amd64
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajalokan picture rajalokan  ยท  3Comments

patvdleer picture patvdleer  ยท  4Comments

tommyknows picture tommyknows  ยท  3Comments

nielsvbrecht picture nielsvbrecht  ยท  3Comments

fgimenez picture fgimenez  ยท  4Comments