Skip to content

Latest commit

History

History
124 lines (86 loc) 路 3.52 KB

USER_GUIDE.md

File metadata and controls

124 lines (86 loc) 路 3.52 KB

User Guide

This guide shows how to use krew as a user after installing it.

Discovering Plugins

To find plugins, run the kubectl krew search command. This command lists all available plugins:

$ kubectl krew search
NAME 聽聽聽聽聽聽聽聽聽聽聽聽聽聽SHORT               聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽STATUS
ca-cert 聽聽聽聽聽聽聽聽聽聽聽Print PEM CA certificate of current cluster 聽聽聽聽聽聽聽available
extract-context 聽聽聽Extract current-context on kubectl as a kubecon... available
krew 聽聽聽聽聽聽聽聽聽聽聽聽聽聽Install plugins 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽    聽available
mtail 聽聽聽聽聽聽聽聽聽聽聽聽聽Tail logs from multiple pods matching label sel... available
view-secret 聽聽聽聽聽聽聽Decode secrets 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽     聽聽available
...

You can specify search keywords as arguments:

$ kubectl krew search crt
NAME 聽聽聽聽聽聽聽聽聽聽聽聽聽聽SHORT 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽              STATUS
ca-cert 聽聽聽聽聽聽聽聽聽聽聽Print PEM CA certificate of current cluster available
view-secret 聽聽聽聽聽聽聽Decode secrets 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽     available

To get more information on a plugin, run kubectl krew info <PLUGIN>:

$ kubectl krew info ca-cert
NAME: ca-cert
URI: https://github.com/ahmetb/kubectl-extras/archive/c403c57.zip
SHA256: 8be8ed348d02285abc46bbf7a4cc83da0ee9d54dc2c5bf86a7b64947811b843c
DESCRIPTION:
聽Pretty print the current cluster certificate.
聽The plugin formats the certificate in PEM following RFC1421.
VERSION: v1.0.0
CAVEATS:
聽This plugin needs the following programs:
聽* base64

Installing Plugins

Plugins can be installed with kubectl krew install command:

$ kubectl krew install ca-cert

Will install plugin: ca-cert
Installing plugin: ca-cert
Installed plugin: ca-cert
CAVEATS:
聽This plugin needs the following programs:
聽* base64

This command downloads the plugin and verifies the integrity of the downloaded file.

After installing a plugin, you can use it like kubectl <PLUGIN>:

kubectl ca-cert

Listing Installed Plugins

All plugins available to kubectl (including those not installed via krew) can be listed using:

kubectl plugin list

To list all plugins installed via krew, run:

kubectl krew list

Upgrading Plugins

Plugins you are using might have newer versions available. To upgrade a single plugin, run:

kubectl krew upgrade <PLUGIN>

If you want to upgrade all plugins to their latest versions, run the same command without any arguments:

kubectl krew upgrade

Since krew itself is a plugin also managed through krew, running the upgrade command may also upgrade your krew version.

Uninstalling Plugins

When you don't need a plugin anymore you can uninstall it with:

kubectl krew uninstall <PLUGIN>

Uninstalling Krew

Uninstalling krew is as easy as deleting its installation directory.

To find krew's installation directory, run:

kubectl krew version

And delete the directory listed in BasePath: field. On macOS/Linux systems, deleting the installation location can be done by executing:

rm -rf ~/.krew