Skip to content

Commit

Permalink
Merge pull request #2 from badele/network-documentation
Browse files Browse the repository at this point in the history
feat: update network graph
  • Loading branch information
badele authored May 14, 2024
2 parents 1116f95 + 70891ea commit 6ddf4f5
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,13 @@ This list generated with `inv docs.all-pages` command

## Network

![Network diagram](./docs/network.png)
| |
| :------------------------------------------------------: |
| generated by `diagrams ./docs/network_architecture.py` |
| ![Network architecture](./docs/network_architecture.png) |
| |
| generated by `plantuml ./docs/network.puml` |
| ![Network diagram](./docs/network.png) |

## Structure

Expand Down
Binary file added docs/icons/computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/laptop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/nixos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/philipshue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/raspberrypi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/tv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/icons/windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/network_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions docs/network_architecture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from diagrams import Cluster
from diagrams import Diagram
from diagrams.custom import Custom
from diagrams.generic.device import Mobile
from diagrams.generic.network import Firewall
from diagrams.generic.network import Router
from diagrams.generic.network import Subnet
from diagrams.generic.network import Switch
from diagrams.onprem.dns import Coredns
from diagrams.onprem.logging import Loki
from diagrams.onprem.monitoring import Grafana
from diagrams.onprem.monitoring import Prometheus
from diagrams.onprem.network import Internet

# onprem

with Diagram("Network Architecture", show=False):
# Subnet
# netpriv = Subnet("subnet\private")
# netdmz = Subnet("subnet\DMZ")
# netvpn = Subnet("subnet\VPN")

# Box
internet = Internet("internet\n81.64.x.x")
wireless1 = Subnet("work\nwireless")
wireless2 = Subnet("home\nwireless")
phones = Mobile("phones")
laptops = Custom("laptops", "./icons/laptop.png")

# bootstore = Custom("bootstore", "./icons/computer.png")

with Cluster("living room"):
mikro254 = Router("micro254\n192.168.254.254")
box = Firewall("box\n192.168.0.x")
boxtv = Custom("boxtv", "./icons/tv.png")

with Cluster("lad room"):
mikro253 = Router("micro253\n192.168.254.253")
hue = Custom("hue\n192.168.0.3", "./icons/philipshue.png")
ladpc = Custom("ladpc", "./icons/computer.png")

with Cluster("services"):
coredns = Coredns("dns")
grafana = Grafana("grafana")
prometheus = Prometheus("prometheus")
loki = Loki("loki")

with Cluster("work room"):
mikro252 = Switch("mikro252\n192.168.254.252")
servers = Custom("servers", "./icons/computer.png")
rpi40 = Custom("rpi40", "./icons/raspberrypi.png")
b4d14 = Custom("b4d14", "./icons/laptop.png")

mikro252 - [servers, rpi40, b4d14]
servers - [coredns, grafana, loki, prometheus]

# Flow
(internet - box - mikro254 - mikro253 - mikro252)

(box - boxtv)

(mikro254 - wireless1)

# (wireless1 >> b4d14)

(mikro253 - [hue, wireless2])

(wireless2 - [phones, laptops])
3 changes: 3 additions & 0 deletions homelab.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
"ipv4": "192.168.254.114",
"zone": "homeoffice",
"parent": "router-ladbedroom",
"roles": [
"virtualization"
],
"description": "Dell XPS 9570 Latop",
"os": "NixOS"
},
Expand Down

0 comments on commit 6ddf4f5

Please sign in to comment.