Metadata-Version: 2.1
Name: kubesurveyor
Version: 1.0.0
Summary: Good enough Kubernetes namespace visualization tool
Home-page: https://github.com/viralpoetry/kubesurveyor
License: MIT
Keywords: kubernetes,graphviz,visualisation
Author: Peter Gasper
Author-email: peter@gasper.cc
Requires-Python: >=3.8,<4.0
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Dist: PyYAML (>=5.4.1,<6.0.0)
Requires-Dist: graphviz (>=0.16,<0.17)
Requires-Dist: kubernetes (>=12.0.1,<13.0.0)
Project-URL: Repository, https://github.com/viralpoetry/kubesurveyor
Description-Content-Type: text/markdown

# 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  

