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. Today, over 70 kubectl plugins are available on krew.
- 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 uninstall view-secret # uninstall a pluginRead the User Guide for detailed documentation.
Check out the list of kubectl plugins available on krew or just run
kubectl krew search to discover plugins available on your OS.
⚠️ Warning: krew is only compatible with kubectl v1.12 or higher.
macOS and Linux:
-
Make sure that
gitis installed. -
Run this command in your terminal to download and install
krew:( set -x; cd "$(mktemp -d)" && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/v0.3.3/krew.{tar.gz,yaml}" && tar zxvf krew.tar.gz && KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" && "$KREW" install --manifest=krew.yaml --archive=krew.tar.gz && "$KREW" update )
-
Add
$HOME/.krew/bindirectory to your PATH environment variable. To do this, update your.bashrcor.zshrcfile and append the following line:export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
and restart your shell.
-
Make sure that
gitis installed. -
Run this command in your terminal to download and install
krew:begin set -x; set temp_dir (mktemp -d); cd "$temp_dir" && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/v0.3.3/krew.{tar.gz,yaml}" && tar zxvf krew.tar.gz && set KREWNAME krew-(uname | tr '[:upper:]' '[:lower:]')_amd64 && ./$KREWNAME install \ --manifest=krew.yaml --archive=krew.tar.gz && set -e KREWNAME; set -e temp_dir end
-
Add
$HOME/.krew/bindirectory to your PATH environment variable. To do this, update yourconfig.fishfile and append the following line:set -gx PATH $PATH $HOME/.krew/bin
and restart your shell.
Windows:
-
Make sure
gitis installed on your system. -
Download
krew.exeandkrew.yamlfrom the Releases page to a directory. -
Launch a command-line window (
cmd.exe) and navigate to that directory. -
Run the following command to install krew (pass the correct paths to
krew.yamlandkrew.zipbelow):krew install --manifest=krew.yaml -
Add
%USERPROFILE%\.krew\bindirectory to yourPATHenvironment 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.
Please check out the Issue Tracker to see the plan of record for new features and changes.
- If you have a problem with the Krew itself, please file an issue in this repository.
- If you're having a problem with a particular plugin's installation or upgrades, file an issue at krew-index repository.
- If you're having an issue with an installed plugin, file an issue for the repository the plugin's source code is hosted at.
- Slack #sig-cli
- Mailing List
- Kubernetes Community site
Interested in contributing to Krew? Please refer to our Contributing Guidelines for more details
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.