In Opensource world everyone seeks for plugin for any major tools and when comes to Kubernetes there is bunch of tools are available and today we are gonna see a tool name called "Krew" it is a plugin manager for Kubectl. Those who are working in Kubernetes this will be really helpful.
Through Krew we can able to install, manage and discover Kubectl plugins. This link has the list of available plugins.Today we will see how to install Krew and use the plugins.
Requirements :
OS : Centos 7.6
Running Kubernetes Cluster
Step 1 :
Login to Kubernetes Master server.
Install krew by below command,
# ( set -x; cd "$(mktemp -d)" && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/v0.3.1/krew.{tar.gz,yaml}" && tar zxvf krew.tar.gz && ./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" install --manifest=krew.yaml --archive=krew.tar.gz; )
Step 2 :
Now we need to add krew as environment path variable,
So add below line in .bashrc
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
Restart the terminal.
Step 3 :
Update the Krew index,
# kubectl krew update
Step 4 :
To list the available plugins,
# kubectl krew search
Step 5 :
To install and list the installed plugins,
# kubectl krew install plugin-name
ex : kubectl krew install resource-capacity
# kubectl krew list
Step 6 :
To use the plugin,
# kubectl plugin-name
ex : kubectl resource-capacity
Step 7 :
To uninstall Krew plugins,
# kubectl krew uninstall plugin-name
ex : kubectl krew uninstall resource-capacity
To uninstall krew from the server,
# rm -rf /root/.krew/
That's all, Krew has been installed and checked one plugin.You can explore more plugins from krew plugins.
Post a Comment