kubectl Install

Ready to get kubectl onto your machine? You've come to the right place.

How to Install

For OSX Users

Option one: You can get kubectl on to your OSX machine with one command using Homebrew:

brew install kubectl

Option two: Feel like using curl instead? No problem:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

For Linux Users

Just input the following command:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

For Windows Users

Command one, for good measure:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/windows/amd64/kubectl.exe

Or, if you prefer, you can use Chocolatey to install:

choco install kubernetes-cli

How to Use

For a deep dive into using kubectl, check out our kubectl guide.

kubectl Plugins

Ever heard of krew? It's something you can use to manage kubectl plugins.

krew is a handy tool that lets you manage kubectl plugins, sort of like apt or yum. It allows you to search for, install, and manage kubectl plugins.

Installing krew

Use the following command:

Once you've got it installed, add the krew binary to your PATH:

Then, you should be able to verify your install with a kubectl command:

How to Use krew

Before your first use, update the plugin index using the following command:

Here's how you can use krew:

After you install your plugins, you'll see a list of external tools that the plugin depends on. You'll need to install these manually.

Finally, you can use the plugin by typing kubectl <plugin-name>:

How to Upgrade krew

Here's your command:

Further Reading

最后更新于