Kubectl — Plugins Operation
Besides default kubectl
operations, you can also use plugins with kubectl
. Under the hood, aplugin in kubectl
is just an executable file (a complied Go program or a Bash shell script, etc), and the name of which begins with kubectl-
. To install the plugin, what yuo need to do is just put its executable file in a directory that’s in your PATH variable.
To intall and manage plugins for kubectl
, I would recommend krew. Krew (https://krew.sigs.k8s.io/) is the K8s plugin manager and is probably the easiest way to find and install plugins.
What is Krew
Krew is the plugin manager for kubectl
command-line tool. Krew helps you:
- Discover kubectl plugins,
- Install them on your machine,
- Keep the installed plugins up-to-date.
krew
provides a simple way to download, retrieve and manage other plugins for kubectl
, similar to Unix/Linux system's apt
, yum
, brew
and other tools. There are about 200+ kubectl
plugins currently distributed on Krew
. Krew
works across all major platforms, like macOS, Linux and Windows.
The kubectl
plugin mechanism was declared stable in K8s v1.14 and entered the GA state. The plugin mechanism of kubectl
is to allow developers to publish…