kubectl/docs/book/pages/extending_kubectl/discovering_plugins.md

1.6 KiB

{% panel style="success", title="Providing Feedback" %} Provide feedback at the survey {% endpanel %}

{% panel style="info", title="TL;DR" %}

  • sigs.k8s.io/krew is a kubernetes sub-project to discover and manage plugins {% endpanel %}

Krew

By design, kubectl does not install plugins. This task is left to the kubernetes sub-project sigs.k8s.io/krew which needs to be installed separately. Krew helps to

  • discover plugins
  • get updates for installed plugins
  • remove plugins

Installing krew

Krew should be used as a kubectl plugin. To set yourself up to using krew, you need to do two things:

  1. Install git
  2. Install krew as described on the project page sigs.k8s.io/krew.
  3. Add the krew bin folder to your PATH environment variable. For example, in bash export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH".

Krew capabilities

{% method %} Discover plugins {% sample lang="yaml" %}

kubectl krew search

{% endmethod %}

{% method %} Install a plugin {% sample lang="yaml" %}

kubectl krew install access-matrix

{% endmethod %}

{% method %} Upgrade all installed plugins {% sample lang="yaml" %}

kubectl krew upgrade

{% endmethod %}

{% method %} Show details about a plugin {% sample lang="yaml" %}

kubectl krew info access-matrix

{% endmethod %}

{% method %} Uninstall a plugin {% sample lang="yaml" %}

kubectl krew uninstall access-matrix

{% endmethod %}