https://github.com/softonic/kubewatch
Kubernetes API event watcher
https://github.com/softonic/kubewatch
command-line go kingpin kubernetes-monitoring
Last synced: 1 day ago
JSON representation
Kubernetes API event watcher
- Host: GitHub
- URL: https://github.com/softonic/kubewatch
- Owner: softonic
- License: other
- Created: 2017-02-27T10:56:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-31T04:56:58.000Z (about 2 years ago)
- Last Synced: 2025-04-10T22:44:12.170Z (2 months ago)
- Topics: command-line, go, kingpin, kubernetes-monitoring
- Language: Go
- Homepage: https://hub.docker.com/r/softonic/kubewatch/
- Size: 12.8 MB
- Stars: 33
- Watchers: 9
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubewatch
[![Version Widget]][Version] [![License Widget]][License] [![GoReportCard Widget]][GoReportCard] [![Travis Widget]][Travis] [![DockerHub Widget]][DockerHub]
[Version]: https://github.com/softonic/kubewatch/releases
[Version Widget]: https://img.shields.io/github/release/softonic/kubewatch.svg?maxAge=60
[License]: http://www.apache.org/licenses/LICENSE-2.0.txt
[License Widget]: https://img.shields.io/badge/license-APACHE2-1eb0fc.svg
[GoReportCard]: https://goreportcard.com/report/softonic/kubewatch
[GoReportCard Widget]: https://goreportcard.com/badge/softonic/kubewatch
[Travis]: https://travis-ci.org/softonic/kubewatch
[Travis Widget]: https://travis-ci.org/softonic/kubewatch.svg?branch=master
[DockerHub]: https://hub.docker.com/r/softonic/kubewatch
[DockerHub Widget]: https://img.shields.io/docker/pulls/softonic/kubewatch.svgKubernetes API event watcher.
##### Install
```
go get -u github.com/softonic/kubewatch
```##### Shell completion
```
eval "$(kubewatch --completion-script-${0#-})"
```##### Help
```
kubewatch --help
usage: kubewatch [] ...Watches Kubernetes resources via its API.
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
--kubeconfig Absolute path to the kubeconfig file.
--namespace Set the namespace to be watched.
--flatten Whether to produce flatten JSON output or not.
--version Show application version.Args:
Space delimited list of resources to be watched.
```##### Out-of-cluster examples:
Watch for `pods` and `events` in all `namespaces`:
```
kubewatch pods events | jq '.'
```Same thing with docker:
```
docker run -it --rm \
-v ~/.kube/config:/root/.kube/config \
softonic/kubewatch pods events | jq '.'
```Watch for `services` events in namespace `foo`:
```
kubewatch --namespace foo services | jq '.'
```Same thing with docker:
```
docker run -it --rm \
-v ~/.kube/config:/root/.kube/config \
softonic/kubewatch --namespace foo services | jq '.'
```##### In-cluster examples:
Run `kubewatch` in the `monitoring` namespace and watch for `pods` in all namespaces:
```
kubectl --namespace monitoring run kubewatch --image softonic/kubewatch -- pods
```Run `kubewatch` in the `monitoring` namespace and watch for `pods`, `deployments` and `events` objects in all namespaces. Also flatten the `json` output:
```
kubectl --namespace monitoring \
run kubewatch --image softonic/kubewatch \
-- --flatten pods deployments events
```