Luk's BlogArchives

Krew the Kubectl Plugin Manager

This summer I had an internship at Google, and it was awesome! I worked on an open source project, which is now called “krew” a kubectl plugin manager. I use krew to discover and install new plugins to my system. You should also start to use a kubectl plugin manager because manual installation of plugins is annoying.


Kubectl Plugins!

If you had asked me 4 months ago, I wouldn’t be able to say if kubectl plugins exist. However, kubectl plugins exist since kubernetes 1.9, which is now almost a year ago. Plugins are fantastic: They help to organize commands under kubectl. Instead of having standalone binaries. They can now be integrated with kubectl. The svcat plugin is a great example.

Krew does the following things for you:

  1. Search and discover plugins
  2. Check for compatibility with your system
  3. Download, verify and install plugins
  4. Keep plugins up-to-date

Where to Start?

Install krew with this gist:

curl -SsL | bash

We have chosen a script to install krew. It is not a bad thing. We don’t rely on other software package managers, because krew itself is a kubectl plugin managed by krew.

Once you got krew installed, you can install other plugins.

Install the ca-cert plugin.

kubectl plugin install ca-cert

Now we have ca-cert installed and can use it with:

kubectl plugin ca-cert