Coder Social home page Coder Social logo

ardaguclu / kubectl-pod-node-matrix Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 59 KB

Kubectl plugin shows [pod status x node] matrix with suitable colors to mitigate troubleshooting effort.

License: Apache License 2.0

Go 100.00%
kubectl-plugins kubectl krew

kubectl-pod-node-matrix's Introduction

kubectl-pod-node-matrix

This plugin shows [pod x node] matrix in terms of pod statuses with suitable colors to mitigate troubleshooting effort.

GoDoc Go Report Card

Details

Troubleshooting in Kubernetes takes some time and sorting out the root cause is sometimes overwhelming. Take an example of a couple of pods are not in running state, but the root cause is node has insufficient disk space. To reduce the amount of time being spent to this troubleshooting, pod-node-matrix might provide a place for "first look at".

pod-node-matrix shows pods status x node in table view. This plugin can clearly indicate that if there is a general node problem, or suggest that node has no problem and instead deployment, service, etc. of this pod can be checked.

Thanks to that, assuring that one part is working or not will narrow down the places will be examined.

Installation

Use krew plugin manager to install,

wget https://github.com/ardaguclu/kubectl-pod-node-matrix/blob/main/.krew.yaml
kubectl krew install pod-node-matrix --manifest=.krew.yaml
kubectl pod-node-matrix --help

Or manually clone the repo and run;

go run cmd/kubectl-pod-node-matrix.go

Usage

# Show pods statuses in default namespace per each node
kubectl pod-node-matrix

# Show pods statuses in given namespace per each node
kubectl pod-node-matrix -n ${NAMESPACE}

# Show pods statuses in all namespaces per each node
kubectl pod-node-matrix -A

# Shows pod statuses in verbose format. 
# It is suggested only there are few nodes.
kubectl pod-node-matrix --verbose

Example

$ go run cmd/kubectl-pod-node-matrix.go -n openshift-machine-api
+----------------------------------------------+---+---+---+---+---+
|                     PODS                     | 0 | 1 | 2 | 3 | 4 |
+----------------------------------------------+---+---+---+---+---+
| cluster-autoscaler-operator-7ffd7cb56d-nn8z6 |   ||   |   |   |
| cluster-baremetal-operator-bb769f679-h7k24   |   ||   |   |   |
| machine-api-controllers-f7c5dc6df-8v9nn      |   |   | x |   |   |
| machine-api-operator-7cdc47bb76-xddpt        |   ||   |   |   |
| metal3-f6cb6d88c-dl4h9                       ||   |   |   |   |
| metal3-image-cache-27v8f                     |   |   | x |   |   |
| metal3-image-cache-kx5xm                     |   ||   |   |   |
| metal3-image-cache-vtw26                     ||   |   |   |   |
| metal3-image-customization-c9bf787c8-vhr8b   |   |   | x |   |   |
+----------------------------------------------+---+---+---+---+---+
+---+----------+
| 0 | master-0 |
| 1 | master-1 |
| 2 | master-2 |
| 3 | worker-0 |
| 4 | worker-1 |
+---+----------+
$ go run cmd/kubectl-pod-node-matrix.go -n kube-system --verbose
+----------------------------------+----------+
|               PODS               | MINIKUBE |
+----------------------------------+----------+
| coredns-78fcd69978-krjqf         | Running  |
| etcd-minikube                    | Running  |
| kube-apiserver-minikube          | Running  |
| kube-controller-manager-minikube | Running  |
| kube-proxy-qcrt6                 | Running  |
| kube-scheduler-minikube          | Running  |
| storage-provisioner              | Running  |
+----------------------------------+----------+

kubectl-pod-node-matrix's People

Contributors

ardaguclu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.