Installing kubectl

To install kubectl, download the appropriate binary for your operating system and processor architecture. Then rename the file to kubectl and save the file in path of your operating system.

If you are using Google Cloud Platform, you can also install kubectl using gcloud cli. You can the details here.

Mac OS X

Linux

Windows

The following sections shows how to install kubectl from command line in Linux or Mac OSX.

Using wget

32 bit

wget -O kubectl https://cdn.appscode.com/binaries/kubectl/1.5.4/kubectl-os-386 \
  && chmod +x kubectl \
  && sudo mv kubectl /usr/local/bin/

64 bit

wget -O kubectl https://cdn.appscode.com/binaries/kubectl/1.5.4/kubectl-os-amd64 \
  && chmod +x kubectl \
  && sudo mv kubectl /usr/local/bin/

Depending on your user level, you may have to use sudo. To verify successful installation, run kubectl version.

Using curl

32 bit

curl -Lo kubectl https://cdn.appscode.com/binaries/kubectl/1.5.4/kubectl-os-386 \
  && chmod +x kubectl \
  && sudo mv kubectl /usr/local/bin/

64 bit

curl -Lo kubectl https://cdn.appscode.com/binaries/kubectl/1.5.4/kubectl-os-amd64 \
  && chmod +x kubectl \
  && sudo mv kubectl /usr/local/bin/

Depending on your user level, you may have to use sudo. To verify successful installation, run kubectl version.

Setup kubectl

The easiest way to setup kubectl to talk to a Kubernetes cluster is to use appctl. First install and setup appctl following the instructions here. Then run the following command to start using kubectl

appctl cluster use <cluster-name>

To verify successful setup, run kubectl get nodes.

Further Reading



Subscribe to our free technical newsletter!

Join thousands of subscribers and stay up-to-date on AppsCode.