https://github.com/qba73/inspector
K8s plugin for running Ingress Controller diagnostics.
https://github.com/qba73/inspector
customer-support diagnostic-tool diagnostics ingress-controller kubectl kubectl-plugins kubernetes-tools technical-support
Last synced: about 1 month ago
JSON representation
K8s plugin for running Ingress Controller diagnostics.
- Host: GitHub
- URL: https://github.com/qba73/inspector
- Owner: qba73
- License: mit
- Created: 2024-04-18T10:02:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-17T04:42:54.000Z (2 months ago)
- Last Synced: 2025-03-25T11:49:11.662Z (about 2 months ago)
- Topics: customer-support, diagnostic-tool, diagnostics, ingress-controller, kubectl, kubectl-plugins, kubernetes-tools, technical-support
- Language: Go
- Homepage:
- Size: 187 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Inspector
[](https://pkg.go.dev/github.com/qba73/inspector)

[](https://goreportcard.com/report/github.com/qba73/inspector)

[](https://github.com/qba73/inspector/actions/workflows/test.yml)
[](https://www.bestpractices.dev/projects/8889)
Before using `inspector` you need to have [kubectl](https://kubernetes.io/docs/tasks/tools/) binary installed and configured (config file `${HOME}/.kube/config`).
`inspector` is a CLI tool and a [Kubernetes plugin](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/) 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
```shell
go install github.com/qba73/inspector/cmd/inspector@latest
```1) Get help:
```shell
inspector -h
``````shell
Usage:inspector [-v] [-h] [-n]
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
```shell
inspector -n default > default.json
```1) Collect data points from `nginx-ingress` namespace
```shell
inspector -n nginx-ingress > nginx-ingress.json
```### How to install it and use as a `kubectl` plugin
1) Clone the repo.
1) Build inspector.```shell
go build -o kubectl-inspector ./cmd/inspector/main.go
```1) Copy the binary to a dir in your `$HOME`, for example:
```shell
cp kubectl-inspector /usr/local/bin/
```1) Verify if the `kubectl` discovers the plugin:
```shell
kubectl plugin list
``````shell
[...]
/usr/local/bin/kubectl-inspector
```1) Verify `inspector` can be run using `kubectl`:
```shell
kubectl inspector -hUsage:
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`.
```shell
kubectl inspector > default.json
```1) Collect data points from `nginx-ingress` namespace
```shell
kubectl inspector -n nginx-ingress > nginx-ingress.json
```## How it works
The program collects K8s cluster and [NGINX Ingress Controller](https://kubernetes.io/docs/concepts/services-networking/ingress/) 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](https://jqlang.github.io/jq/)) for further parsing and processing.
## Collected data points
Currently `inspector` collects following data points:
- K8s version
- K8s cluster id
- Number of nodes in the cluster
- K8s platform name
- Pods
- Logs from pods
- Events
- ConfigMaps
- Services
- Deployments
- StatefulSets
- ReplicaSets
- Leases
- CRDs
- IngressClasses
- Ingresses
- IngressAnnotationsPlanned:
- Nodes metrics
- Ingress Controller stats, options and configurationFuture releases will add support for collecting [K8s Gateway API](https://kubernetes.io/docs/concepts/services-networking/gateway/) diagnostics.
## Contributing
If you'd like to contribute to **Inspector**, please read the [Contributing guide](CONTRIBUTING.md).
Gopher image by [Gopherize.me](https://gopherize.me)