diff --git a/README.md b/README.md index 1645a72..14f0742 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/icons/computer.png b/docs/icons/computer.png new file mode 100644 index 0000000..3fea54f Binary files /dev/null and b/docs/icons/computer.png differ diff --git a/docs/icons/laptop.png b/docs/icons/laptop.png new file mode 100644 index 0000000..59d4c25 Binary files /dev/null and b/docs/icons/laptop.png differ diff --git a/docs/icons/nixos.png b/docs/icons/nixos.png new file mode 100644 index 0000000..3d59468 Binary files /dev/null and b/docs/icons/nixos.png differ diff --git a/docs/icons/philipshue.png b/docs/icons/philipshue.png new file mode 100644 index 0000000..f2ec748 Binary files /dev/null and b/docs/icons/philipshue.png differ diff --git a/docs/icons/raspberrypi.png b/docs/icons/raspberrypi.png new file mode 100644 index 0000000..1d433c2 Binary files /dev/null and b/docs/icons/raspberrypi.png differ diff --git a/docs/icons/tv.png b/docs/icons/tv.png new file mode 100644 index 0000000..842b014 Binary files /dev/null and b/docs/icons/tv.png differ diff --git a/docs/icons/windows.png b/docs/icons/windows.png new file mode 100644 index 0000000..2c01443 Binary files /dev/null and b/docs/icons/windows.png differ diff --git a/docs/network.png b/docs/network.png index bab945f..64ddc64 100644 Binary files a/docs/network.png and b/docs/network.png differ diff --git a/docs/network_architecture.png b/docs/network_architecture.png new file mode 100644 index 0000000..e04553d Binary files /dev/null and b/docs/network_architecture.png differ diff --git a/docs/network_architecture.py b/docs/network_architecture.py new file mode 100644 index 0000000..be6fee8 --- /dev/null +++ b/docs/network_architecture.py @@ -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]) diff --git a/homelab.json b/homelab.json index 9409b61..03f3453 100644 --- a/homelab.json +++ b/homelab.json @@ -276,6 +276,9 @@ "ipv4": "192.168.254.114", "zone": "homeoffice", "parent": "router-ladbedroom", + "roles": [ + "virtualization" + ], "description": "Dell XPS 9570 Latop", "os": "NixOS" },