Kubernetes tools

Kubernetes tools

There is the following list of tools to be used when working with Kubernetes:

kubectx

https://github.com/ahmetb/kubectx

brew install kubectx

This command installs two tools: kubectx and kubens.

You can use kubectx to switch between different clusters with 'kubectx my-cluster-name'. Behind the scenes, this command will edit your ~/.kube/config file to mark a specific cluster as being the current context. You would otherwise have to edit this file manually or use 'kubectl config use-context my-cluster-name'.

kube-ps1

https://github.com/jonmosco/kube-ps1

brew install kube-ps1

kube-ps1 is a co-tool to kubectx and kubens which shows the currently active cluster and namespace on your command line prompt.

(⎈ |amazon-project-x:default)➜  ~/own/k8s/project-x

OhMyZSH

https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/kubectl

OhMyZSH has a plugin for kubectl which gives you around a hundred shortcuts for commonly used commands.

To use it, add kubectl to the plugins array in your ~/.zshrc file and then source the ~/.zshrc file like before:

plugins=(... kubectl)
source ~/.zshrc

Full list of shortcuts is here.

stern

https://github.com/wercker/stern

stern has been designed to allow you to tail the logs of pods and containers. This means that you can search pods by partial name matches, rather than having the full names of pods and then running 'kubectl logs -f' with the exact name of every pod.

brew install stern

To tail all the available logs of all pods whose names partially match myProjectX (assuming default namespace of the minikube cluster used with kubectx, kubens and kube-ps1):

(⎈ |minikube:default)➜  ~ stern myProjectX

kpoof

https://github.com/farmotive/kpoof

With kpoof, you get an interactive namespace and pod chooser which you would like to port-forward. The tool forwards the same local port number as the port exposed by the pod by default.

brew tap farmotive/k8s
brew install kpoof

Popeye

https://github.com/derailed/popeye

Popeye is a tool that scans your cluster for misconfigurations in your resources. Currently, nodes, namespaces, pods, and services are supported for scanning.

When your cluster grows to 100s of different pods and to 10s of different namespaces, having such a tool is invaluable in detecting issues before they blow up, especially if you don't have monitoring on some of these resources.

brew install derailed/popeye/popeye

Run with the command 'popeye' to examine your resources in the selected cluster. 



To view or add a comment, sign in

More articles by Eugene Goncharuk

Others also viewed

Explore content categories