Install kubectl
Before you begin
You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.2 client should work with v1.1, v1.2, and v1.3 master. Using the latest version of kubectl helps avoid unforeseen issues.
Install kubectl on Linux
Install kubectl binary with curl on Linux
Download the latest release with the command:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectlTo download a specific version, replace the
$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)portion of the command with the specific version.For example, to download version v1.14.0 on Linux, type:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectlMake the kubectl binary executable.
chmod +x ./kubectlMove the binary in to your PATH.
sudo mv ./kubectl /usr/local/bin/kubectlTest to ensure the version you installed is up-to-date:
kubectl version
Install using native package management
Install with snap
If you are on Ubuntu or another Linux distribution that support snap package manager, kubectl is available as a snap application.
Switch to the snap user and run the installation command:
Test to ensure the version you installed is up-to-date:
Last updated
Was this helpful?