Installing plugins
A plugin in kubectl
is just an executable file (it could be a complied Go program or a Bash shell script, among other things) the name of which begins with kubectl-
, and to install the plugin you just have to put its executable file in a directory that's in your PATH
variable.
The easiest way to find and install plugins is by using Krew (https://krew.sigs.k8s.io/), the Kubernetes plugin manager. Krew is available for macOS, Linux, and Windows.
Krew is a Kubernetes plugin, so let's go ahead and install it. For this example, we are going to use macOS:
- To install Krew on macOS, run the
$ brew install krew
command as shown in the following screenshot: - Next, we need to download the plugin list:
$ kubectl krew update
- When we have a locally cached list of all the plugins, let's check for available plugins by running the
$ kubectl krew search
command as shown in the following screenshot...