Home

Awesome

kubectl-plugins

CI Status

A collection of plugins for kubectl integration (for Kubectl versions >= 1.12.0)

A portion of these plugins are available on krew as well.

Note

Install on Linux/Mac

git clone https://github.com/jordanwilson230/kubectl-plugins.git
cd kubectl-plugins
./install-plugins.sh
source ~/.bash_profile

To Uninstall

rm -rf ~/.kube/plugins/jordanwilson230
ex '+g/jordanwilson230/d' -cwq ~/.bash_profile

Remove the image plugin:

ex '+g/IMG_REGISTRY=/d' -cwq ~/.bash_profile

Remove the prompt plugin:

ex '+g/function kubectl()/d' -cwq ~/.bash_profile
ex '+g/KUBECTL_\(.*\)_PROMPT/d' -cwq ~/.bash_profile

kubectl ssh

kapssh

Usage: kubectl ssh [OPTIONAL: -n <namespace>] [OPTIONAL: -u <user>] [OPTIONAL: -c <Container Name>] [REQUIRED: <PodName> ] -- [command]

Example: kubectl ssh -n default -u root -c prometheus prometheus-282sd0s2 -- bash

OptionRequiredDescriptionExample
-hNShow usagekubectl ssh -h
-dNEnable debug mode. Print a trace of each commandskubectl ssh -d kafka-0
-nNThe namespace scope for this CLI requestkubectl ssh -n infra kafka-0
-uNUser to exec as. Defaults to rootkubectl ssh -u kafka kafka-0
-cNSpecify container within podkubectl ssh -c burrow-metrics kafka-0
--NPass an optional command. Defaults to /bin/shkubectl ssh kafka -- ls /etc/burrow

kubectl switch

switch

OptionRequiredDescriptionExample
-lNList available clusters and prompts for selection. Can only be used when cluster is passed.kubNctl switch cluster -l
-hNShow usagekubectl switch -h

kubectl prompt

prompt

kubectl image

image

Example: kubectl image kafka

kubectl ip

kap_ip

Example: kubectl ip cassandra

kubectl uptime

kap_uptime

Example: kubectl uptime