|
| 1 | +from diagrams import Diagram, Cluster, Edge |
| 2 | +from diagrams.custom import Custom |
| 3 | +from diagrams.onprem.security import Vault |
| 4 | +from diagrams.onprem.network import Zookeeper |
| 5 | +from diagrams.onprem.queue import Kafka |
| 6 | +from diagrams.elastic.elasticsearch import Elasticsearch |
| 7 | +from diagrams.elastic.elasticsearch import Kibana |
| 8 | +from diagrams.elastic.elasticsearch import Logstash |
| 9 | +from diagrams.onprem.container import Docker |
| 10 | +from diagrams.programming.language import Python |
| 11 | +from diagrams.generic.storage import Storage |
| 12 | +from diagrams.onprem.database import Mongodb |
| 13 | +from diagrams.onprem.database import Influxdb |
| 14 | +from diagrams.onprem.monitoring import Grafana |
| 15 | +from diagrams.onprem.ci import TC |
| 16 | + |
| 17 | + |
| 18 | +def main(): |
| 19 | + graph_attr = { |
| 20 | + "fontsize": "45", |
| 21 | + 'overlap_scaling': '100', |
| 22 | + 'size': '24!', |
| 23 | + 'ratio': 'expand' |
| 24 | + } |
| 25 | + |
| 26 | + with Diagram(name='Automation Framework Kubernetes', direction='LR', graph_attr=graph_attr): |
| 27 | + with Cluster('Docker Cluster'): |
| 28 | + docker = Docker('Docker') |
| 29 | + |
| 30 | + with Cluster('container1'): |
| 31 | + python_container = Python('APIs\nOther Microservices') |
| 32 | + |
| 33 | + with Cluster('Docker Registry'): |
| 34 | + docker_registry_container = Docker('Docker Registry\ntcp:5000') |
| 35 | + |
| 36 | + with Cluster('Docker Registry Browser'): |
| 37 | + docker_registry_browser_container = Python('Docker Registry Browser\ntcp:8088') |
| 38 | + |
| 39 | + with Cluster('BatFish'): |
| 40 | + batfish_container = Custom('BatFish\ntcp:8888\ntcp:9997\ntcp:9996', 'custom_icons/BatFish.png') |
| 41 | + |
| 42 | + with Cluster('Secrets Managers'): |
| 43 | + vault = Vault('HashiCorp Vault\ntcp:8200') |
| 44 | + secrets_managers = [ |
| 45 | + vault, |
| 46 | + ] |
| 47 | + |
| 48 | + with Cluster('Logging and Search'): |
| 49 | + with Cluster('ELK Stack'): |
| 50 | + elastic_search = Elasticsearch('Elastic Search\ntcp:9200') |
| 51 | + kibana = Kibana('Kibana\ntcp:5601') |
| 52 | + logstash = Logstash('Logstash\ntcp:5044') |
| 53 | + search_log = [ |
| 54 | + elastic_search, |
| 55 | + kibana, |
| 56 | + logstash |
| 57 | + ] |
| 58 | + |
| 59 | + with Cluster('Influxdb'): |
| 60 | + infulxdb = Influxdb('Influxdb\ntcp:8086') |
| 61 | + |
| 62 | + with Cluster('Grafana'): |
| 63 | + grafana = Grafana('Grafana\ntcp:3000') |
| 64 | + |
| 65 | + with Cluster('Database'): |
| 66 | + with Cluster('Mongo dB'): |
| 67 | + mongodb = Mongodb('MongoDb\ntcp:27017') |
| 68 | + mongodb_express = Mongodb('MongoDb Express\ntcp:8181') |
| 69 | + mongo_group = [ |
| 70 | + mongodb, |
| 71 | + mongodb_express |
| 72 | + ] |
| 73 | + |
| 74 | + with Cluster('CI/CD'): |
| 75 | + team_city = TC('TeamCity') |
| 76 | + |
| 77 | + |
| 78 | + python_container - vault |
| 79 | + |
| 80 | + python_container - logstash |
| 81 | + |
| 82 | + python_container - infulxdb |
| 83 | + |
| 84 | + python_container - mongodb |
| 85 | + |
| 86 | + |
| 87 | +if __name__ == '__main__': |
| 88 | + main() |
0 commit comments