Start basic diagram for services
This commit is contained in:
parent
81c0797bd8
commit
bf0f991b49
2 changed files with 73 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
*.secret.env
|
||||
|
||||
serguzim.net.png
|
||||
|
|
71
diagram.py
Normal file
71
diagram.py
Normal file
|
@ -0,0 +1,71 @@
|
|||
""" Diagram to visualize serguzim.net """
|
||||
|
||||
from diagrams import Cluster, Diagram
|
||||
|
||||
from diagrams.oci.compute import Container, OCIRegistry
|
||||
from diagrams.oci.storage import ObjectStorage
|
||||
|
||||
from diagrams.onprem.ci import Droneci
|
||||
from diagrams.onprem.database import Influxdb, Postgresql
|
||||
from diagrams.onprem.monitoring import Grafana, Prometheus
|
||||
from diagrams.onprem.network import Caddy
|
||||
from diagrams.onprem.vcs import Gitea
|
||||
|
||||
def add_to_groups(service, *groups):
|
||||
""" Add a service to groups like 'db_users' """
|
||||
for group in groups:
|
||||
group.append(service)
|
||||
|
||||
|
||||
with Diagram("serguzim.net", show=False):
|
||||
|
||||
node002 = Cluster("node002.serguzim.net")
|
||||
node004 = Cluster("node004.serguzim.net")
|
||||
|
||||
exoscale_objectstore = ObjectStorage("Exoscale Object Storage")
|
||||
|
||||
with node002:
|
||||
services = []
|
||||
db_users = []
|
||||
objectstore_users = []
|
||||
|
||||
proxy = Caddy()
|
||||
|
||||
ci = Droneci("ci.serguzim.me")
|
||||
add_to_groups(ci, services, db_users)
|
||||
|
||||
db_time = Influxdb("tick.serguzim.me")
|
||||
add_to_groups(db_time, services, db_users)
|
||||
|
||||
db = Postgresql("db.serguzim.me")
|
||||
|
||||
graph = Grafana("graph.serguzim.me")
|
||||
add_to_groups(graph, services, db_users)
|
||||
|
||||
mail = Container("mail.serguzim.me")
|
||||
add_to_groups(mail, services)
|
||||
|
||||
matrix = Container("matrix.serguzim.me")
|
||||
add_to_groups(matrix, services, db_users, objectstore_users)
|
||||
|
||||
prometheus = Prometheus("prometheus.serguzim.me")
|
||||
add_to_groups(prometheus, services)
|
||||
|
||||
registry = OCIRegistry("registry.serguzim.me")
|
||||
add_to_groups(registry , services, db_users, objectstore_users)
|
||||
|
||||
vcs = Gitea("git.serguzim.me")
|
||||
add_to_groups(vcs, services, db_users)
|
||||
|
||||
db_users >> db
|
||||
proxy >> services
|
||||
objectstore_users >> exoscale_objectstore
|
||||
|
||||
with node004:
|
||||
services = []
|
||||
|
||||
proxy = Caddy()
|
||||
minecraft = Container("minecraft.serguzim.me")
|
||||
add_to_groups(minecraft, services)
|
||||
|
||||
proxy >> services
|
Reference in a new issue