Skip to content
Krew - kubectl Plugin Manager Guide

Krew - kubectl Plugin Manager Guide

Krew is the official package manager for discovering, installing, and managing kubectl plugins.


1. What Is Krew?

Krew is a plugin management tool dedicated to kubectl, playing a role similar to apt or yum on Linux or brew on macOS.

Key Concepts

  • Standardization: All plugins can be installed and updated in the same way.
  • Official hub: Provides hundreds of vetted community plugins.
  • Multi-platform: Supports Linux, macOS, and Windows.
    graph LR
    Krew[Krew CLI] -- "1. search/install" --> Index[Krew Plugin Index]
    Index -- "2. Download" --> Krew
    Krew -- "3. Register to PATH" --> Kubectl[kubectl plugin list]
  

2. Benefits of Using Krew

CategoryManual InstallationUsing Krew
SearchSearch GitHub and similar sites yourselfInstant search with kubectl krew search
InstallManually copy files and set permissionsJust kubectl krew install <name>
UpdateCheck for a new version and reinstallUpdate everything at once with kubectl krew upgrade
RemoveFind the file location and delete it manuallykubectl krew uninstall <name>

3. Recommended kubectl Plugins (Top 5)

Plugin NameMain FunctionInstall Command
nsSwitch namespaces quickly and easilykubectl krew install ns
ctxQuickly switch between multiple cluster contextskubectl krew install ctx
oidc-loginAutomate OIDC authentication with Keycloak and otherskubectl krew install oidc-login
treeVisualize the hierarchy between resourceskubectl krew install tree
who-canAnalyze who is allowed to perform a given actionkubectl krew install who-can

4. Key Command Summary

  • Update index: kubectl krew update
  • Search plugins: kubectl krew search <keyword>
  • Install a plugin: kubectl krew install <name>
  • List installed: kubectl krew list
  • Upgrade plugins: kubectl krew upgrade
  • Remove a plugin: kubectl krew uninstall <name>

5. Conclusion

With Krew, you can integrate powerful management tools that go beyond the basic features of kubectl into your cluster operations workflow with just a few commands. It is an essential tool for any experienced Kubernetes administrator.