123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- from diagrams import Cluster, Diagram
- from diagrams.azure.database import SQLDatabases
- from diagrams.onprem.inmemory import Redis
- from diagrams.onprem.network import Nginx, Internet
- from diagrams.onprem.groupware import Nextcloud
- from diagrams.digitalocean.network import LoadBalancer
- import diagrams.generic.storage as storage_1
- from diagrams.azure.identity import Groups
- from diagrams.custom import Custom
- with Diagram(filename="assets/dia_nc_improved", show=False, direction="TB"):
- out = Internet("Internet")
- with Cluster("Load Balancing"):
- openstack_lb = Custom("", "./openstack.png")
- lb = [Nginx("SSL proxy 1"), Nginx("SSL proxy 2")]
- with Cluster("Web servers"):
- openstack_web = Custom("", "./openstack.png")
- nc_frontend = [ Groups("local LDAP slave") - Nextcloud(),
- Groups("local LDAP slave") - Nextcloud(),
- Groups("local LDAP slave") - Nextcloud(),
- Groups("local LDAP slave") - Nextcloud()]
- with Cluster("Caching"):
- openstack_cach = Custom("", "./openstack.png")
- redis = [Redis("Redis 1"), Redis("Redis 2")]
- with Cluster("LDAP"):
- openstack_ldap = Custom("", "./openstack.png")
- ldap = Groups()
- with Cluster("Database cluster"):
- with Cluster("Load Balancer"):
- openstack_dblb = Custom("", "./openstack.png")
- nc_dblb = LoadBalancer()
- with Cluster("Databases"):
- openstack_db = Custom("", "./openstack.png")
- SQLDatabases("Master") >> [SQLDatabases("Slave 1"),
- SQLDatabases("Slave 2")]
- nc_frontend >> storage_1.Storage("NFS")
- openstack_cach << nc_frontend
- openstack_web >> openstack_dblb
- openstack_lb >> openstack_web
- openstack_web << ldap
- nc_dblb >> openstack_db
- out >> lb
|