https://github.com/MrSir/k8s_diagram
A simple package to generate mermaid.js diagram of your Kubernetes Cluster
https://github.com/MrSir/k8s_diagram
Last synced: 4 months ago
JSON representation
A simple package to generate mermaid.js diagram of your Kubernetes Cluster
- Host: GitHub
- URL: https://github.com/MrSir/k8s_diagram
- Owner: MrSir
- License: gpl-3.0
- Created: 2024-04-26T23:54:23.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-09T14:44:46.000Z (about 1 year ago)
- Last Synced: 2024-05-09T15:58:12.860Z (about 1 year ago)
- Language: Python
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubernetes-architecture-diagrams - k8s_diagram - at/MrSir/k8s_diagram)   |  | (Generation Tools / Comparison Table)
- awesome-kubernetes-architecture-diagrams - k8s_diagram - at/MrSir/k8s_diagram)   |  | (Generation Tools / Comparison Table)
README
# k8s_diagram
A simple package to generate mermaid.js diagram of your Kubernetes Cluster## Use
```python
from k8s_diagram.main import FORMATS, K8sDiagrammerendpoint = ""
cert_path = ""
api_key = ""
excluded_namespaces = {
"default",
"kube-system",
}# E.g. Mermaid JS Rendering
diagrammer = K8sDiagrammer(FORMATS.MERMAID_JS, endpoint, api_key, cert_path=cert_path, excluded_namespaces=excluded_namespaces)
print(diagrammer.renderer().graph_code)
diagrammer.render()# E.g. Diagrams Rendering
diagrammer = K8sDiagrammer(FORMATS.DIAGRAMS, endpoint, api_key, cert_path=cert_path, excluded_namespaces=excluded_namespaces)
diagrammer.render()# The resulting diagram will be stored in `diagrams/diagram.png`
```