Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
qba73 committed May 4, 2024
1 parent 00f20dc commit aa71c41
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 5 deletions.
75 changes: 73 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,78 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/qba73/inspector)](https://goreportcard.com/report/github.com/qba73/inspector)



# inspector

`inspector` is a Kubernetes plugin that allows you to run basic cluster diagnostics, collect Ingress Controller logs, and generate reports.
`inspector` is a CLI tool and a Kubernetes plugin for running cluster diagnostics, collecting cluster and Ingress Controller logs and diagnostics, and generating reports.

Here's how to install it and use as a CLI tool:

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

`inspector` requires `kubectl` and the config file `${HOME}/.kube/config`.

To run it:

```shell
inspector
```

```shell
Usage:
inspector [-v] namespace

Collect K8s and NIC diagnostics in the given namespace

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

```shell
inspector default
```

```shell
=== Cluster Info ===
Version: v1.29.2
ClusterID: f66852d1-6d39-40a9-b4c7-c05e39d22332
Nodes: 1
Platform: kind
=== Pods ===
&PodList{ListMeta:{ 11582 <nil>},Items:[]Pod{},}
=== Pod logs ===
...
```

## How it works

The program checks and collects K8s cluster and [Ingress Controller](https://kubernetes.io/docs/concepts/services-networking/ingress/) diagnostics data. It prints out data to the stdout. This allows the output to be piped to other tools for further parsing and processing.

## Collected data points

Currently collected data:

- K8s version
- K8s cluster id
- Number of nodes in the cluster
- K8s platform name
- Pods
- Logs from pods

Planned:

- Events
- ConfigMaps
- Services
- Deployments
- StatefulSets
- ReplicaSets
- Leases
- CRDs
- IngressClasses
- Ingresses
- IngressAnnotations
- Nodes metrics
- Ingress Controller stats, options and configuration

Future releases will add support for collecting [K8s Gateway API](https://kubernetes.io/docs/concepts/services-networking/gateway/) diagnostics.
7 changes: 4 additions & 3 deletions inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ func (c *Client) Report(ctx context.Context, namespace string) (Report, error) {
}, nil
}

var usage = `Usage: inspector [-v] namespace
var usage = `Usage:
inspector [-v] namespace
Gather K8s and NIC diagnostics in the given namespace
Collect K8s and NIC diagnostics in the given namespace
In verbose mode (-v), prints out all data points to stdout.`
In verbose mode (-v), prints out progess, steps and all data points to stdout.`

func Main() int {
verbose := flag.Bool("v", false, "verbose output")
Expand Down

0 comments on commit aa71c41

Please sign in to comment.