DEV Community

Cover image for Here is the package manager for k8s : krew
Javid Mougamadou
Javid Mougamadou

Posted on

Here is the package manager for k8s : krew

Concepts

Krew is a tool that makes it easy to use kubectl plugins. Krew helps you discover plugins, install and manage them on your machine. It is similar to tools like apt, dnf or brew. Today, over 100 kubectl plugins are available on Krew.

Quick start

Installation (Linux/macOS)

  • Install krew with this command line :
(
  set -x; cd "$(mktemp -d)" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
  tar zxvf krew.tar.gz &&
  KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/' -e 's/aarch64$/arm64/')" &&
  "$KREW" install krew
)
Enter fullscreen mode Exit fullscreen mode
  • Then export it in environment variable :
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Plugins

Alt Text

https://krew.sigs.k8s.io/plugins/

You can install plugins with this command line :

kubectl krew install <PLUGIN_NAME>
Enter fullscreen mode Exit fullscreen mode

Example :

kubectl krew install access-matrix
kubectl access-matrix
Enter fullscreen mode Exit fullscreen mode

Popular Plugins :

kubectl krew install popeye

kubectl krew install score

kubectl krew install ctx

kubectl krew install ns
Enter fullscreen mode Exit fullscreen mode

Link

https://github.com/kubernetes-sigs/krew

Top comments (2)

Collapse
 
omrisama profile image
Omri Gabay

Is Krew official? How does it compare to Helm?

Collapse
 
javidjms profile image
Javid Mougamadou

Krew is an unofficial package that allows to install some k8S related package/plugins.

Helm Charts allows to deploy kubernetes ressources with yaml templates.