krew is the package manager for kubectl plugins.
krew is a tool that makes it easy to use kubectl plugins. krew helps you discover plugins, install and manage them on your machine. It is similar to tools like apt, dnf or brew.
- For kubectl users: krew helps you find, install and manage kubectl plugins in a consistent way.
- For plugin developers: krew helps you package and distribute your plugins on multiple platforms and makes them discoverable.
krew is easy to use:
kubectl krew search # show all plugins
kubectl krew install view-secret # install a plugin named "view-secret"
kubectl view-secret # use the plugin
kubectl krew upgrade # upgrade installed plugins
kubectl krew remove view-secret # uninstall a plugin
Read the User Guide for detailed documentation.
⚠️ Warning: krew is only compatible with kubectl v1.12 or higher.
macOS and Linux:
-
Make sure that
git
is installed. -
Run this command in your terminal to download and install
krew
:( set -x; cd "$(mktemp -d)" && curl -fsSLO "https://storage.googleapis.com/krew/v0.2.1/krew.{tar.gz,yaml}" && tar zxvf krew.tar.gz && ./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" install \ --manifest=krew.yaml --archive=krew.tar.gz )
-
Add
$HOME/.krew/bin
directory to your PATH environment variable. To do this, update your.bashrc
or.zshrc
file and append the following line:export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
and restart your shell.
Windows:
-
Make sure
git
is installed on your system. -
Download
krew.zip
andkrew.yaml
from the Releases page. -
Extract the
krew.zip
archive to a directory, navigate to the directory. -
Launch a command-line window (
cmd.exe
) in that directory. -
Run the following command to install krew (pass the correct paths to
krew.yaml
andkrew.zip
below):.\krew-windows_amd64.exe install --manifest=krew.yaml --archive=krew.zip
-
Add
%USERPROFILE%\.krew\bin
to yourPATH
environment variable (how?)
Run kubectl plugin list
command to see installed plugins. This command should
show kubectl-krew
in the results. You can now use kubectl krew
command.
Since krew itself is installed as a "kubectl plugin" managed by krew, it can be
upgraded like a plugin by running the kubectl krew upgrade
command.
- Users:
- Read the User Guide to learn how to use krew.
- Plugin Developers:
- Developer Guide: how to package and publish a plugin for krew.
- Naming Guide: how to choose a good name for your plugin
- Krew Developers:
- Building Krew (not written yet)
- Releasing Krew: how to release new version of krew.
- Plugin Lifecycle: how krew installs/upgrades plugins and itself.
- Krew Architecture: architectural decisions behind designing krew.
Visit ./docs
for all documentation.
- Support Multiple Index Repositories: Tracked under #23
- Donating krew to the SIG-CLI: We plan to donate krew to the SIG-CLI. We have created a KEP that covers our intentions. Accepting the KEP means that kubectl will implement krew commands natively, and support the plugin format.
The code is submitted under the Apache 2.0 License described in the LICENSE file.
This is not an official Google project.