You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble figuring out why this diagram is coming out so lopsided. I've experimented with layouts but I've been stuck for a while now. Could someone advise how to make this more symmetrical? I'm aware of using neato layout and position numbers to hard code it as outlined here but I'd like to avoid that if possible. Thanks for any advice! Also, I'm aware that the color scheme is horrific I just needed a quick and dirty dark mode to work in.
from diagrams import Diagram, Cluster, Edge
from diagrams.generic.os import Ubuntu, Windows
from diagrams.k8s.infra import Master, Node
from diagrams.k8s.compute import Deployment
from diagrams.k8s.storage import StorageClass
diagram_attr = { "fontcolor": "white", "bgcolor": "black" }
with Diagram("Homelab", graph_attr=diagram_attr) as diag:
baremetal_cluster_attr = { "fontcolor": "white", "bgcolor": "gray20" }
with Cluster("Bare Metal Servers", graph_attr=baremetal_cluster_attr) as baremetal_cluster:
server_attr = { "fontcolor": "white" }
bigrig = Windows("bigrig", **server_attr)
oppenheimer = Ubuntu("oppenheimer", **server_attr)
ASUSan = Ubuntu("ASUSan", **server_attr)
k8s_cluster_attr = { "fontcolor": "black", "bgcolor": "gray40" }
with Cluster("MicroK8s Cluster", graph_attr=k8s_cluster_attr) as microk8s:
k8s_node_attr = { "fontcolor": "black" }
master1 = Master("oppenheimer", **k8s_node_attr)
node1 = Node("bigrig", **k8s_node_attr)
node2 = Node("ASUSan", **k8s_node_attr)
deploy_cluster_attr = { "bgcolor": "gray60" }
with Cluster("Kubernetes Deployments", graph_attr=deploy_cluster_attr) as k8s_deployments:
deploy_node_attr = { "fontcolor": "black" }
plex = Deployment("plex", **deploy_node_attr)
nfs = StorageClass("nfs", **deploy_node_attr)
master1 - Edge(color="gray20") - [node1, node2]
oppenheimer >> Edge(color="dodgerblue") >> master1
bigrig >> Edge(color="dodgerblue") >> node1
ASUSan >> Edge(color="dodgerblue") >> node2
diag
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having trouble figuring out why this diagram is coming out so lopsided. I've experimented with layouts but I've been stuck for a while now. Could someone advise how to make this more symmetrical? I'm aware of using neato layout and position numbers to hard code it as outlined here but I'd like to avoid that if possible. Thanks for any advice! Also, I'm aware that the color scheme is horrific I just needed a quick and dirty dark mode to work in.
Beta Was this translation helpful? Give feedback.
All reactions