dia_nc_improved.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. from diagrams import Cluster, Diagram
  2. from diagrams.azure.database import SQLDatabases
  3. from diagrams.onprem.inmemory import Redis
  4. from diagrams.onprem.network import Internet
  5. from diagrams.onprem.groupware import Nextcloud
  6. from diagrams.onprem.monitoring import Grafana, Prometheus
  7. from diagrams.onprem.storage import Ceph, CephOsd
  8. from diagrams.onprem.network import Haproxy
  9. from diagrams.digitalocean.network import LoadBalancer
  10. import diagrams.generic.storage as storage_1
  11. from diagrams.azure.identity import Groups
  12. from diagrams.custom import Custom
  13. with Diagram(filename="./assets/dia_nc_improved", show=False, direction="TB"):
  14. out = Internet("Internet")
  15. with Cluster("Load Balancing"):
  16. openstack_lb = Custom("", "../assets/openstack.png")
  17. lb = [Haproxy("SSL proxy 1"), Haproxy("SSL proxy 2")]
  18. with Cluster("Web servers"):
  19. openstack_web = Custom("", "../assets/openstack.png")
  20. nc_frontend = [ Groups("local LDAP slave") - Nextcloud(),
  21. Groups("local LDAP slave") - Nextcloud(),
  22. Groups("local LDAP slave") - Nextcloud(),
  23. Groups("local LDAP slave") - Nextcloud()]
  24. with Cluster("Caching"):
  25. openstack_cach = Custom("", "../assets/openstack.png")
  26. redis = [Redis("Redis 1"), Redis("Redis 2")]
  27. with Cluster("LDAP"):
  28. openstack_ldap = Custom("", "../assets/openstack.png")
  29. ldap = Groups()
  30. with Cluster("Control / Monitor"):
  31. openstack_ctrl = Custom("", "../assets/openstack.png")
  32. ctrl = [Prometheus(), Grafana()]
  33. with Cluster("Database cluster"):
  34. with Cluster("Load Balancer"):
  35. openstack_dblb = Custom("", "../assets/openstack.png")
  36. nc_dblb = LoadBalancer()
  37. with Cluster("Databases"):
  38. openstack_db = Custom("", "../assets/openstack.png")
  39. SQLDatabases("Master") >> [SQLDatabases("Slave 1"),
  40. SQLDatabases("Slave 2")]
  41. with Cluster("Ceph Storage Cluster"):
  42. ceph_cluster = Ceph()
  43. ceph_object = CephOsd("Object Gateway")
  44. nc_frontend >> storage_1.Storage("NFS")
  45. nc_frontend >> ceph_cluster
  46. openstack_cach << nc_frontend
  47. openstack_web >> openstack_dblb
  48. openstack_lb >> openstack_web
  49. openstack_web << ldap
  50. nc_dblb >> openstack_db
  51. out >> lb
  52. openstack_web >> openstack_ctrl << openstack_dblb