Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Gasper committed May 21, 2021
1 parent ad2d1b6 commit f3b8afa
Show file tree
Hide file tree
Showing 7 changed files with 469 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.txt
*.json
*.yaml
*.pdf
*.gv
examples
dist
poetry.lock
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,59 @@
# kubesurveyor
Good enough Kubernetes namespace visualization tool
# Kubesurveyor

Good enough Kubernetes namespace visualization tool.
No provisioning to a cluster required, only Kubernetes API is scrapped.

<img src='https://github.com/viralpoetry/kubesurveyor/raw/main/kubesurveyor.jpg'/>

## Installation
```
sudo apt-get install graphviz
pip install kubesurveyor
```

## Usage

Export path to a custom certification authority, if you use one for your Kubernetes cluster API
```
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
```

Alternatively, ignore K8S API certificate errors using `--insecure` or `-k`
```
kubesurveyor <namespace> --insecure
```

Show `<namespace>` namespace as a `dot` language graph, using currently active K8S config context
```
kubesurveyor <namespace>
```

Specify context to be used, if there are multiple in the K8S config file
```
kubesurveyor <namespace> --context <context>
```

Dump crawled namespace data to a `YAML` format for later processing
```
kubesurveyor <namespace> --context <context> --save > namespace.yaml
```

Load from `YAML` file, show as `dot` language graph
```
cat namespace.yaml | kubesurveyor <namespace> --load
```

Load from `YAML` file and render as `png` visualization to a current working directory
```
cat namespace.yaml | kubesurveyor <namespace> --load --out png
```

If you want to generate architecture image from `dot` definition by hand, use `dot` directly
```
dot -Tpng k8s.dot > k8s.png
```

Limitations:
- unconnected pods, services are not shown
- could have problems with deployments created by Tiller
- number of replicas is not tracked
Binary file added kubesurveyor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions kubesurveyor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/usr/bin/env python3
Loading

0 comments on commit f3b8afa

Please sign in to comment.