inspector

Inspector

Go Reference GitHub go.mod Go version Go Report Card GitHub Tests OpenSSF Best Practices

Magical gopher logo

Before using inspector you need to have kubectl binary installed and configured (config file ${HOME}/.kube/config).

inspector is a CLI tool and a Kubernetes plugin for running Cluster and Ingress Conroller diagnostics, collecting Cluster and Ingress Controller logs and generating reports.

How to install inspector

How to install it and use as a CLI tool

1) Install Go binary

   go install github.com/qba73/inspector/cmd/inspector@latest

1) Get help:

   inspector -h
   Usage:

      inspector [-v] [-h] [-n] <namespace>

   Collect K8s and NIC diagnostics in the given namespace

   In verbose mode (-v), prints out progess, steps and all data points to stdout.

1) Collect data points from default namespace

   inspector -n default > default.json

1) Collect data points from nginx-ingress namespace

   inspector -n nginx-ingress > nginx-ingress.json

How to install it and use as a kubectl plugin

1) Clone the repo. 1) Build inspector.

   go build -o kubectl-inspector ./cmd/inspector/main.go

1) Copy the binary to a dir in your $HOME, for example:

   cp kubectl-inspector /usr/local/bin/

1) Verify if the kubectl discovers the plugin:

   kubectl plugin list
   [...]
   /usr/local/bin/kubectl-inspector

1) Verify inspector can be run using kubectl:

   kubectl inspector -h

   Usage:

      inspector [-h] [-v] [-n] namespace

   Collect K8s and Ingress Controller diagnostics in the given namespace.

   In verbose mode (-v), prints out progess, steps and all data points to stdout.

1) Collect data points from default namespace

Note that inspector’s default namespace is default.

   kubectl inspector > default.json

1) Collect data points from nginx-ingress namespace

   kubectl inspector -n nginx-ingress > nginx-ingress.json

How it works

The program collects K8s cluster and NGINX Ingress Controller diagnostics data. It prints out data in the JSON format to the stdout. This allows the output to be piped to other tools (for example jq) for further parsing and processing.

Collected data points

Currently inspector collects following data points:

Planned:

Future releases will add support for collecting K8s Gateway API diagnostics.

Contributing

If you’d like to contribute to Inspector, please read the Contributing guide.

Gopher image by Gopherize.me