kubespy: tools for observing Kubernetes resources in real time
What happens when you boot up a
Pod? What happens to a
Service before it is allocated a public IP address? How often is a
Deployment's status changing?
kubespy is a small tool that makes it easy to observe how Kubernetes resources change in real time. Run
kubespy at any point in time, and it will watch and report information about a Kubernetes resource continuously until you kill it.
kubespy status v1 Pod nginx will continuously emit changes made to a
Pod's status as syntax-highlighted JSON diffs:
kubespy depends on:
Once installed, run the following:
go get github.com/pulumi/kubespy cd "$(go env GOPATH)/src/github.com/pulumi/kubespy" dep ensure # If $GOBIN is not on your path, you'll need to install the library elsewhere. go install github.com/pulumi/kubespy/cmd/kubespy
From here you can simply run
kubespy has two commands:
status <apiVersion> <kind> [<namespace>/]<name>, which in real time emits all changes made to the
.statusfield of an arbitrary Kubernetes resource, as a JSON diff.
changes <apiVersion> <kind> [<namespace>/]<name>, which in real time emits all changes to any field in a Kubernetes resource, as a JSON diff.
Several more commands are planned as well.
For a concrete example you can run using either Pulumi or
kubectl, check out examples/trivial-pulumi-example.
- Supports any resources the API server knows about, including CRDs (i.e., uses the discovery client to discover the available API resources, and allows users to query any of them).
- Displays changes to API objects in real time.
- Supports case-insensitive aliases (e.g.
kubespy status v1 pod <name>instead of
kubespy status v1 Pod <name>).
- Supports status updates from regex and/or fuzzy matching (i.e., make it easy to watch the status of
Pods generated by